Skip to content

Commit

Permalink
Reverting this CL to see if this fixes chrome frame unit test failures.
Browse files Browse the repository at this point in the history
Revert 42684 - Implements IDeleteBrowsing history and moves the GCF profile into the IE TIF directory for nonpriv mode users on IE < 8.

Implementation notes:

Earlier work enabled InPrivate browsing detection and mapped it to creation of an incognito profile instance.Privacy features and how they operate with this change:

"Delete Browsing History":

	IE 6 & 7: all history (including databases) is deleted if cache is cleared *WITHOUT* an active Chrome process holding references to the profile resources. If GCF is rendering a page when the cache is cleared, history *WILL NOT* be deleted on the GCF side, however GCF will continue to operate and IE will remove all other history artifacts as usual.

	IE 8: GCF cache is cleared in alignment with the options specified by the user. Clearing Temporary Internet Files may destroy the profile entirely, and so we need to consider not moving the GCF profile on IE 8.

"InPrivate Filtering":

	IE 8 (only): more testing required.

"InPrivate Browsing":

	IE 8 (only): pages rendered in GCF *after* entering InPrivate mode are not persisted to disk (use an incognito wrapper on the specified profile). Currently displayed pages are not effected by the switch, although refreshing them will invoke the new behavior. Generally speaking, BHO's are disabled by IE 8 while in InPrivate mode, so entering this state is wonky to begin with but we handle it as well as can be expected.

BUG=22846
TEST=On IE 8, clear the cache entirely, note GCF entries in DbgView (better tests coming)
Review URL: http://codereview.chromium.org/858003

TBR=slightlyoff@chromium.org
Review URL: http://codereview.chromium.org/1353002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42691 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
ananta@chromium.org committed Mar 25, 2010
1 parent 1522387 commit 141c26d
Show file tree
Hide file tree
Showing 20 changed files with 97 additions and 353 deletions.
10 changes: 0 additions & 10 deletions chrome/browser/automation/automation_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "chrome/browser/bookmarks/bookmark_storage.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/browsing_data_remover.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/dom_operation_notification_details.h"
#include "chrome/browser/debugger/devtools_manager.h"
Expand Down Expand Up @@ -507,7 +506,6 @@ void AutomationProvider::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WaitForPopupMenuToOpen,
WaitForPopupMenuToOpen)
#endif
IPC_MESSAGE_HANDLER(AutomationMsg_RemoveBrowsingData, RemoveBrowsingData)
IPC_END_MESSAGE_MAP()
}

Expand Down Expand Up @@ -2351,14 +2349,6 @@ void AutomationProvider::OnSetPageFontSize(int tab_handle,
}
}

void AutomationProvider::RemoveBrowsingData(int remove_mask) {
BrowsingDataRemover* remover;
remover = new BrowsingDataRemover(profile(),
BrowsingDataRemover::EVERYTHING, // All time periods.
base::Time());
remover->Remove(remove_mask);
// BrowsingDataRemover deletes itself.
}

void AutomationProvider::WaitForBrowserWindowCountToBecome(
int target_count, IPC::Message* reply_message) {
Expand Down
3 changes: 0 additions & 3 deletions chrome/browser/automation/automation_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,6 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,

void OnSetPageFontSize(int tab_handle, int font_size);

// See browsing_data_remover.h for explanation of bitmap fields.
void RemoveBrowsingData(int remove_mask);

void InstallExtension(const FilePath& crx_path,
IPC::Message* reply_message);

Expand Down
5 changes: 2 additions & 3 deletions chrome/browser/automation/chrome_frame_automation_provider.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Expand Down Expand Up @@ -62,8 +62,7 @@ bool ChromeFrameAutomationProvider::IsValidMessage(uint32 type) {
case AutomationMsg_RequestStarted::ID:
case AutomationMsg_RequestData::ID:
case AutomationMsg_RequestEnd::ID:
case AutomationMsg_SaveAsAsync::ID:
case AutomationMsg_RemoveBrowsingData::ID: {
case AutomationMsg_SaveAsAsync::ID: {
is_valid_message = true;
break;
}
Expand Down
8 changes: 1 addition & 7 deletions chrome/test/automation/automation_messages_internal.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Expand Down Expand Up @@ -1307,10 +1307,4 @@ IPC_BEGIN_MESSAGES(Automation)
IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_WaitForPopupMenuToOpen,
bool /* success */)

// This message informs the browser process to remove the history entries
// for the specified types across all time ranges. See
// browsing_data_remover.h for a list of REMOVE_* types supported in the
// remove_mask parameter.
IPC_MESSAGE_ROUTED1(AutomationMsg_RemoveBrowsingData, int)

IPC_END_MESSAGES(Automation)
14 changes: 0 additions & 14 deletions chrome_frame/bho.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include <atlbase.h>
#include <atlcom.h>
#include <deletebrowsinghistory.h>
#include <exdisp.h>
#include <exdispid.h>
#include <mshtml.h>
Expand All @@ -17,14 +16,11 @@

#include "base/scoped_comptr_win.h"
#include "chrome_tab.h" // NOLINT
#include "chrome_frame/delete_chrome_history.h"
#include "chrome_frame/resource.h"
#include "chrome_frame/urlmon_moniker.h"
#include "chrome_frame/urlmon_url_request.h"
#include "grit/chrome_frame_resources.h"

class DeleteChromeHistory;

class PatchHelper {
public:
enum State { UNKNOWN, PATCH_IBROWSER, PATCH_PROTOCOL };
Expand Down Expand Up @@ -59,18 +55,12 @@ class ATL_NO_VTABLE Bho
IBrowserService* browser, IShellView* shell_view, BOOL done,
VARIANT* in_arg, VARIANT* out_arg);

DECLARE_GET_CONTROLLING_UNKNOWN()
DECLARE_REGISTRY_RESOURCEID(IDR_BHO)
DECLARE_NOT_AGGREGATABLE(Bho)
DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(Bho)
COM_INTERFACE_ENTRY(IObjectWithSite)
// When calling DeleteChromeHistory, ensure that only one instance
// is created to avoid mulitple message loops.
COM_INTERFACE_ENTRY_CACHED_TEAR_OFF(IID_IDeleteBrowsingHistory,
DeleteChromeHistory,
delete_chrome_history_.p)
END_COM_MAP()

BEGIN_SINK_MAP(Bho)
Expand Down Expand Up @@ -106,10 +96,6 @@ END_SINK_MAP()

static void ProcessOptInUrls(IWebBrowser2* browser, BSTR url);

// COM_INTERFACE_ENTRY_CACHED_TEAR_OFF manages the raw pointer from CComPtr
// which ScopedComPtr doesn't expose.
CComPtr<IUnknown> delete_chrome_history_;

protected:
bool PatchProtocolHandler(const CLSID& handler_clsid);

Expand Down
49 changes: 23 additions & 26 deletions chrome_frame/bho.rgs
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
HKLM {
NoRemove SOFTWARE {
NoRemove Classes {
ChromeFrame.Bho.1 = s 'Bho Class' {
CLSID = s '{ECB3C477-1A0A-44bd-BB57-78F9EFE34FA7}'
}
ChromeFrame.Bho = s 'ChromeFrame BHO' {
CLSID = s '{ECB3C477-1A0A-44bd-BB57-78F9EFE34FA7}'
CurVer = s 'ChromeFrame.Bho.1'
}
NoRemove CLSID {
ForceRemove {ECB3C477-1A0A-44bd-BB57-78F9EFE34FA7} = s 'ChromeFrame BHO' {
ProgID = s 'ChromeFrame.Bho.1'
VersionIndependentProgID = s 'ChromeFrame.Bho'
InprocServer32 = s '%MODULE%' {
val ThreadingModel = s 'Apartment'
}
'TypeLib' = s '{6F2664E1-FF6E-488A-BCD1-F4CA6001DFCC}'
'Implemented Categories' {
{31CAF6E4-D6AA-4090-A050-A5AC8972E9EF}
}
}
}
}
}
}
HKLM {
NoRemove SOFTWARE {
NoRemove Classes {
ChromeFrame.Bho.1 = s 'Bho Class' {
CLSID = s '{ECB3C477-1A0A-44bd-BB57-78F9EFE34FA7}'
}
ChromeFrame.Bho = s 'ChromeFrame BHO' {
CLSID = s '{ECB3C477-1A0A-44bd-BB57-78F9EFE34FA7}'
CurVer = s 'ChromeFrame.Bho.1'
}
NoRemove CLSID {
ForceRemove {ECB3C477-1A0A-44bd-BB57-78F9EFE34FA7} = s 'ChromeFrame BHO' {
ProgID = s 'ChromeFrame.Bho.1'
VersionIndependentProgID = s 'ChromeFrame.Bho'
InprocServer32 = s '%MODULE%' {
val ThreadingModel = s 'Apartment'
}
'TypeLib' = s '{6F2664E1-FF6E-488A-BCD1-F4CA6001DFCC}'
}
}
}
}
}
10 changes: 4 additions & 6 deletions chrome_frame/chrome_frame.gyp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

Expand Down Expand Up @@ -604,10 +604,10 @@
'chrome_active_document.rgs',
'chrome_frame_activex.cc',
'chrome_frame_activex.h',
'chrome_frame_activex.rgs',
'chrome_frame_activex_base.h',
'chrome_frame_histograms.cc',
'chrome_frame_activex.rgs',
'chrome_frame_histograms.h',
'chrome_frame_histograms.cc',
'chrome_frame_reporting.cc',
'chrome_frame_reporting.h',
'chrome_protocol.cc',
Expand All @@ -619,14 +619,12 @@
'com_message_event.h',
'com_type_info_holder.cc',
'com_type_info_holder.h',
'delete_chrome_history.cc',
'delete_chrome_history.h',
'find_dialog.cc',
'find_dialog.h',
'function_stub.h',
'http_negotiate.cc',
'function_stub.cc',
'http_negotiate.h',
'http_negotiate.cc',
'iids.cc',
'in_place_menu.h',
'ole_document_impl.h',
Expand Down
39 changes: 17 additions & 22 deletions chrome_frame/chrome_frame_activex_base.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Expand All @@ -9,6 +9,21 @@
#include <atlcom.h>
#include <atlctl.h>
#include <wininet.h>

// Copied min/max defs from windows headers to appease atlimage.h.
// TODO(slightlyoff): Figure out of more recent platform SDK's (> 6.1)
// undo the janky "#define NOMINMAX" train wreck. See:
// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=100703
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b)) // NOLINT
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b)) // NOLINT
#endif
#include <atlimage.h>
#undef max
#undef min

#include <shdeprecated.h> // for IBrowserService2
#include <shlguid.h>

Expand All @@ -21,23 +36,19 @@
#include "base/scoped_variant_win.h"
#include "base/string_util.h"
#include "grit/chrome_frame_resources.h"
#include "chrome/common/url_constants.h"
#include "chrome_frame/chrome_frame_plugin.h"
#include "chrome_frame/com_message_event.h"
#include "chrome_frame/com_type_info_holder.h"
#include "chrome_frame/simple_resource_loader.h"
#include "chrome_frame/urlmon_url_request.h"
#include "chrome_frame/urlmon_url_request_private.h"
#include "chrome_frame/utils.h"
#include "chrome/common/url_constants.h"
#include "grit/generated_resources.h"
#include "net/base/cookie_monster.h"

// Include without path to make GYP build see it.
#include "chrome_tab.h" // NOLINT

static const wchar_t kIexploreProfileName[] = L"iexplore";
static const wchar_t kRundllProfileName[] = L"rundll32";

// Connection point class to support firing IChromeFrameEvents (dispinterface).
template<class T>
class ATL_NO_VTABLE ProxyDIChromeFrameEvents
Expand Down Expand Up @@ -350,22 +361,6 @@ END_MSG_MAP()
}

protected:
virtual void GetProfilePath(const std::wstring& profile_name,
FilePath* profile_path) {
bool is_IE = (lstrcmpi(profile_name.c_str(), kIexploreProfileName) == 0) ||
(lstrcmpi(profile_name.c_str(), kRundllProfileName) == 0);
// Browsers without IDeleteBrowsingHistory in non-priv mode
// have their profiles moved into "Temporary Internet Files".
if (is_IE && GetIEVersion() < IE_8 && !is_privileged_) {
*profile_path = GetIETemporaryFilesFolder();
*profile_path = profile_path->Append(L"Google Chrome Frame");
} else {
ChromeFramePlugin::GetProfilePath(profile_name, profile_path);
}
DLOG(INFO) << __FUNCTION__ << ": " << profile_path->value();
}


void OnLoad(int tab_handle, const GURL& url) {
if (ready_state_ < READYSTATE_COMPLETE) {
ready_state_ = READYSTATE_COMPLETE;
Expand Down
36 changes: 24 additions & 12 deletions chrome_frame/chrome_frame_automation.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Expand All @@ -19,6 +19,8 @@
#include "base/waitable_event.h"
#include "chrome/app/client_util.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/automation/tab_proxy.h"
#include "chrome_frame/chrome_launcher.h"
Expand Down Expand Up @@ -269,9 +271,20 @@ void ProxyFactory::CreateProxy(ProxyFactory::ProxyCacheEntry* entry,
if (IsHeadlessMode())
command_line->AppendSwitch(switches::kFullMemoryCrashReport);

DLOG(INFO) << "Profile path: " << params.profile_path.value();
command_line->AppendSwitchWithValue(switches::kUserDataDir,
params.profile_path.value());
// Place the profile directory in
// "<chrome_exe_path>\..\User Data\<profile-name>"
if (!entry->profile_name.empty()) {
FilePath profile_path;
if (chrome::GetChromeFrameUserDataDirectory(&profile_path)) {
profile_path = profile_path.Append(entry->profile_name);
command_line->AppendSwitchWithValue(switches::kUserDataDir,
profile_path.value());
} else {
// Can't get the profile dir :-( We need one to work, so fail.
// We have no code for launch failure.
entry->launch_result = AutomationLaunchResult(-1);
}
}

std::wstring command_line_string(command_line->command_line_string());
// If there are any extra arguments, append them to the command line.
Expand Down Expand Up @@ -326,6 +339,8 @@ void ProxyFactory::CreateProxy(ProxyFactory::ProxyCacheEntry* entry,
}

bool ProxyFactory::ReleaseAutomationServer(void* server_id) {
DLOG(INFO) << __FUNCTION__;

if (!server_id) {
NOTREACHED();
return false;
Expand Down Expand Up @@ -442,7 +457,7 @@ bool ChromeFrameAutomationClient::Initialize(
ChromeFrameDelegate* chrome_frame_delegate,
int automation_server_launch_timeout,
bool perform_version_check,
const FilePath& profile_path,
const std::wstring& profile_name,
const std::wstring& extra_chrome_arguments,
bool incognito) {
DCHECK(!IsWindow());
Expand Down Expand Up @@ -482,8 +497,7 @@ bool ChromeFrameAutomationClient::Initialize(

chrome_launch_params_.automation_server_launch_timeout =
automation_server_launch_timeout;
chrome_launch_params_.profile_path = profile_path;
chrome_launch_params_.profile_name = profile_path.BaseName().value();
chrome_launch_params_.profile_name = profile_name;
chrome_launch_params_.extra_chrome_arguments = extra_chrome_arguments;
chrome_launch_params_.perform_version_check = perform_version_check;
chrome_launch_params_.url = navigate_after_initialization_ ? GURL() : url_;
Expand All @@ -497,6 +511,8 @@ bool ChromeFrameAutomationClient::Initialize(
}

void ChromeFrameAutomationClient::Uninitialize() {
DLOG(INFO) << __FUNCTION__;

if (init_state_ == UNINITIALIZED) {
DLOG(WARNING) << __FUNCTION__ << ": Automation client not initialized";
return;
Expand Down Expand Up @@ -914,7 +930,6 @@ void ChromeFrameAutomationClient::LaunchComplete(
NULL, NULL, NULL);
automation_server_->SendAsAsync(message, NewCallback(this,
&ChromeFrameAutomationClient::CreateExternalTabComplete), this);
DLOG(INFO) << __FUNCTION__ << ": sending CreateExternalTabComplete";
}
}
} else {
Expand Down Expand Up @@ -1084,6 +1099,7 @@ void ChromeFrameAutomationClient::SetParentWindow(HWND parent_window) {
}

void ChromeFrameAutomationClient::ReleaseAutomationServer() {
DLOG(INFO) << __FUNCTION__;
if (automation_server_id_) {
// Cache the server id and clear the automation_server_id_ before
// calling ReleaseAutomationServer. The reason we do this is that
Expand Down Expand Up @@ -1201,10 +1217,6 @@ void ChromeFrameAutomationClient::SetPageFontSize(
new AutomationMsg_SetPageFontSize(0, tab_handle_, font_size));
}

void ChromeFrameAutomationClient::RemoveBrowsingData(int remove_mask) {
automation_server_->Send(
new AutomationMsg_RemoveBrowsingData(0, remove_mask));
}

//////////////////////////////////////////////////////////////////////////
// PluginUrlRequestDelegate implementation.
Expand Down
Loading

0 comments on commit 141c26d

Please sign in to comment.