Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: chrome_frame/delete_chrome_history.cc

Issue 1343002: Re-submit of GCF privacy patch in:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/delete_chrome_history.h ('k') | chrome_frame/test/automation_client_mock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/delete_chrome_history.cc
===================================================================
--- chrome_frame/delete_chrome_history.cc (revision 0)
+++ chrome_frame/delete_chrome_history.cc (revision 0)
@@ -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;
+}
+
+
Property changes on: chrome_frame\delete_chrome_history.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome_frame/delete_chrome_history.h ('k') | chrome_frame/test/automation_client_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698