| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Implementation of DeleteChromeHistory | 5 // Implementation of DeleteChromeHistory |
| 6 #include "chrome_frame/delete_chrome_history.h" | 6 #include "chrome_frame/delete_chrome_history.h" |
| 7 | 7 |
| 8 #include "chrome_frame/chrome_frame_activex.h" | 8 #include "chrome_frame/chrome_frame_activex.h" |
| 9 #include "chrome/browser/browsing_data_remover.h" | 9 #include "chrome/browser/browsing_data_remover.h" |
| 10 #include "utils.h" | 10 #include "utils.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // Usually called inside a quick startup/tear-down routine by RunDLL32. You | 50 // Usually called inside a quick startup/tear-down routine by RunDLL32. You |
| 51 // can simulate the process by calling: | 51 // can simulate the process by calling: |
| 52 // RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255 | 52 // RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255 |
| 53 // Since automation setup isn't synchronous, we can be tearing down while | 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. | 54 // being only partially set-up, causing even synchronous IPCs to be dropped. |
| 55 // Since the *Chrome* startup/tear-down occurs synchronously from the | 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 | 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 | 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. | 58 // happens in one-off fashion, don't attempt to pack REMOVE_* arguments. |
| 59 // Instead, have the browser process clobber all history. | 59 // Instead, have the browser process clobber all history. |
| 60 if (!InitializeAutomation(GetHostProcessName(false), L"", false)) { | 60 if (!InitializeAutomation(GetHostProcessName(false), L"", false, false)) { |
| 61 return E_UNEXPECTED; | 61 return E_UNEXPECTED; |
| 62 } | 62 } |
| 63 | 63 |
| 64 if (flags & DELETE_BROWSING_HISTORY_COOKIES) | 64 if (flags & DELETE_BROWSING_HISTORY_COOKIES) |
| 65 remove_mask_ |= BrowsingDataRemover::REMOVE_COOKIES; | 65 remove_mask_ |= BrowsingDataRemover::REMOVE_COOKIES; |
| 66 if (flags & DELETE_BROWSING_HISTORY_TIF) | 66 if (flags & DELETE_BROWSING_HISTORY_TIF) |
| 67 remove_mask_ |= BrowsingDataRemover::REMOVE_CACHE; | 67 remove_mask_ |= BrowsingDataRemover::REMOVE_CACHE; |
| 68 if (flags & DELETE_BROWSING_HISTORY_FORMDATA) | 68 if (flags & DELETE_BROWSING_HISTORY_FORMDATA) |
| 69 remove_mask_ |= BrowsingDataRemover::REMOVE_FORM_DATA; | 69 remove_mask_ |= BrowsingDataRemover::REMOVE_FORM_DATA; |
| 70 if (flags & DELETE_BROWSING_HISTORY_PASSWORDS) | 70 if (flags & DELETE_BROWSING_HISTORY_PASSWORDS) |
| 71 remove_mask_ |= BrowsingDataRemover::REMOVE_PASSWORDS; | 71 remove_mask_ |= BrowsingDataRemover::REMOVE_PASSWORDS; |
| 72 if (flags & DELETE_BROWSING_HISTORY_HISTORY) | 72 if (flags & DELETE_BROWSING_HISTORY_HISTORY) |
| 73 remove_mask_ |= BrowsingDataRemover::REMOVE_HISTORY; | 73 remove_mask_ |= BrowsingDataRemover::REMOVE_HISTORY; |
| 74 | 74 |
| 75 loop_.PostDelayedTask(FROM_HERE, | 75 loop_.PostDelayedTask(FROM_HERE, |
| 76 new MessageLoop::QuitTask, 1000 * 600); | 76 new MessageLoop::QuitTask, 1000 * 600); |
| 77 loop_.MessageLoop::Run(); | 77 loop_.MessageLoop::Run(); |
| 78 | 78 |
| 79 return S_OK; | 79 return S_OK; |
| 80 } | 80 } |
| 81 | 81 |
| 82 | 82 |
| OLD | NEW |