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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Implementation of DeleteChromeHistory
6 #include "chrome_frame/delete_chrome_history.h"
7
8 #include "chrome_frame/chrome_frame_activex.h"
9 #include "chrome/browser/browsing_data_remover.h"
10 #include "utils.h"
11
12 // Below other header to avoid symbol pollution.
13 #define INITGUID
14 #include <deletebrowsinghistory.h>
15
16 DeleteChromeHistory::DeleteChromeHistory()
17 : remove_mask_(0) {
18 DLOG(INFO) << __FUNCTION__;
19 }
20
21 DeleteChromeHistory::~DeleteChromeHistory() {
22 }
23
24
25 HRESULT DeleteChromeHistory::FinalConstruct() {
26 DLOG(INFO) << __FUNCTION__;
27 Initialize();
28 return S_OK;
29 }
30
31 void DeleteChromeHistory::OnAutomationServerReady() {
32 DLOG(INFO) << __FUNCTION__;
33 automation_client_->RemoveBrowsingData(remove_mask_);
34 loop_.Quit();
35 }
36
37 void DeleteChromeHistory::OnAutomationServerLaunchFailed(
38 AutomationLaunchResult reason, const std::string& server_version) {
39 DLOG(WARNING) << __FUNCTION__;
40 loop_.Quit();
41 }
42
43 void DeleteChromeHistory::GetProfilePath(const std::wstring& profile_name,
44 FilePath* profile_path) {
45 ChromeFramePlugin::GetProfilePath(kIexploreProfileName, profile_path);
46 }
47
48 STDMETHODIMP DeleteChromeHistory::DeleteBrowsingHistory(DWORD flags) {
49 DLOG(INFO) << __FUNCTION__;
50 // Usually called inside a quick startup/tear-down routine by RunDLL32. You
51 // can simulate the process by calling:
52 // RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
53 // Since automation setup isn't synchronous, we can be tearing down while
54 // being only partially set-up, causing even synchronous IPCs to be dropped.
55 // Since the *Chrome* startup/tear-down occurs synchronously from the
56 // perspective of automation, we can add a flag to the chrome.exe invocation
57 // in lieu of sending an IPC when it seems appropriate. Since we assume this
58 // happens in one-off fashion, don't attempt to pack REMOVE_* arguments.
59 // Instead, have the browser process clobber all history.
60 if (!InitializeAutomation(GetHostProcessName(false), L"", false)) {
61 return E_UNEXPECTED;
62 }
63
64 if (flags & DELETE_BROWSING_HISTORY_COOKIES)
65 remove_mask_ |= BrowsingDataRemover::REMOVE_COOKIES;
66 if (flags & DELETE_BROWSING_HISTORY_TIF)
67 remove_mask_ |= BrowsingDataRemover::REMOVE_CACHE;
68 if (flags & DELETE_BROWSING_HISTORY_FORMDATA)
69 remove_mask_ |= BrowsingDataRemover::REMOVE_FORM_DATA;
70 if (flags & DELETE_BROWSING_HISTORY_PASSWORDS)
71 remove_mask_ |= BrowsingDataRemover::REMOVE_PASSWORDS;
72 if (flags & DELETE_BROWSING_HISTORY_HISTORY)
73 remove_mask_ |= BrowsingDataRemover::REMOVE_HISTORY;
74
75 loop_.PostDelayedTask(FROM_HERE,
76 new MessageLoop::QuitTask, 1000 * 600);
77 loop_.MessageLoop::Run();
78
79 return S_OK;
80 }
81
82
OLDNEW
« 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