summaryrefslogtreecommitdiffstats
path: root/chrome_frame/delete_chrome_history.cc
diff options
context:
space:
mode:
authorslightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 22:30:03 +0000
committerslightlyoff@chromium.org <slightlyoff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 22:30:03 +0000
commitb1208f04eb82316e5d84f4a3115c52ae55b845a9 (patch)
tree4382a9152193149dcea630bcbfc3705f19d7c7cd /chrome_frame/delete_chrome_history.cc
parent4fdb9c6bc7cb6f38b951f8255fca0df9794196f4 (diff)
downloadchromium_src-b1208f04eb82316e5d84f4a3115c52ae55b845a9.zip
chromium_src-b1208f04eb82316e5d84f4a3115c52ae55b845a9.tar.gz
chromium_src-b1208f04eb82316e5d84f4a3115c52ae55b845a9.tar.bz2
Implements IDeleteBrowsing history and moves the GCF profile into the IE TIF directory for non-priv 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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42684 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/delete_chrome_history.cc')
-rw-r--r--chrome_frame/delete_chrome_history.cc82
1 files changed, 82 insertions, 0 deletions
diff --git a/chrome_frame/delete_chrome_history.cc b/chrome_frame/delete_chrome_history.cc
new file mode 100644
index 0000000..994d609
--- /dev/null
+++ b/chrome_frame/delete_chrome_history.cc
@@ -0,0 +1,82 @@
+// Copyright (c) 2010 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.
+
+// Implementation of DeleteChromeHistory
+#include "chrome_frame/delete_chrome_history.h"
+
+#include "chrome_frame/chrome_frame_activex.h"
+#include "chrome/browser/browsing_data_remover.h"
+#include "utils.h"
+
+// Below other header to avoid symbol pollution.
+#define INITGUID
+#include <deletebrowsinghistory.h>
+
+DeleteChromeHistory::DeleteChromeHistory()
+ : remove_mask_(0) {
+ DLOG(INFO) << __FUNCTION__;
+}
+
+DeleteChromeHistory::~DeleteChromeHistory() {
+}
+
+
+HRESULT DeleteChromeHistory::FinalConstruct() {
+ DLOG(INFO) << __FUNCTION__;
+ Initialize();
+ return S_OK;
+}
+
+void DeleteChromeHistory::OnAutomationServerReady() {
+ DLOG(INFO) << __FUNCTION__;
+ automation_client_->RemoveBrowsingData(remove_mask_);
+ loop_.Quit();
+}
+
+void DeleteChromeHistory::OnAutomationServerLaunchFailed(
+ AutomationLaunchResult reason, const std::string& server_version) {
+ DLOG(WARNING) << __FUNCTION__;
+ loop_.Quit();
+}
+
+void DeleteChromeHistory::GetProfilePath(const std::wstring& profile_name,
+ FilePath* profile_path) {
+ ChromeFramePlugin::GetProfilePath(kIexploreProfileName, profile_path);
+}
+
+STDMETHODIMP DeleteChromeHistory::DeleteBrowsingHistory(DWORD flags) {
+ DLOG(INFO) << __FUNCTION__;
+ // Usually called inside a quick startup/tear-down routine by RunDLL32. You
+ // can simulate the process by calling:
+ // RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
+ // Since automation setup isn't synchronous, we can be tearing down while
+ // being only partially set-up, causing even synchronous IPCs to be dropped.
+ // Since the *Chrome* startup/tear-down occurs synchronously from the
+ // perspective of automation, we can add a flag to the chrome.exe invocation
+ // in lieu of sending an IPC when it seems appropriate. Since we assume this
+ // happens in one-off fashion, don't attempt to pack REMOVE_* arguments.
+ // Instead, have the browser process clobber all history.
+ if (!InitializeAutomation(GetHostProcessName(false), L"", false)) {
+ return E_UNEXPECTED;
+ }
+
+ if (flags & DELETE_BROWSING_HISTORY_COOKIES)
+ remove_mask_ |= BrowsingDataRemover::REMOVE_COOKIES;
+ if (flags & DELETE_BROWSING_HISTORY_TIF)
+ remove_mask_ |= BrowsingDataRemover::REMOVE_CACHE;
+ if (flags & DELETE_BROWSING_HISTORY_FORMDATA)
+ remove_mask_ |= BrowsingDataRemover::REMOVE_FORM_DATA;
+ if (flags & DELETE_BROWSING_HISTORY_PASSWORDS)
+ remove_mask_ |= BrowsingDataRemover::REMOVE_PASSWORDS;
+ if (flags & DELETE_BROWSING_HISTORY_HISTORY)
+ remove_mask_ |= BrowsingDataRemover::REMOVE_HISTORY;
+
+ loop_.PostDelayedTask(FROM_HERE,
+ new MessageLoop::QuitTask, 1000 * 600);
+ loop_.MessageLoop::Run();
+
+ return S_OK;
+}
+
+