OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Defines the Chrome Extensions Clear API functions, which entail | 5 // Defines the Chrome Extensions Clear API functions, which entail |
6 // clearing browsing data, and clearing the browser's cache (which, let's be | 6 // clearing browsing data, and clearing the browser's cache (which, let's be |
7 // honest, are the same thing), as specified in | 7 // honest, are the same thing), as specified in |
8 // chrome/common/extensions/api/extension_api.json. | 8 // chrome/common/extensions/api/extension_api.json. |
9 | 9 |
10 #include "chrome/browser/extensions/extension_clear_api.h" | 10 #include "chrome/browser/extensions/extension_clear_api.h" |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "chrome/browser/browsing_data_remover.h" | 15 #include "chrome/browser/browsing_data_remover.h" |
16 #include "chrome/browser/extensions/extension_clear_api_constants.h" | 16 #include "chrome/browser/extensions/extension_clear_api_constants.h" |
17 #include "chrome/browser/plugin_data_remover.h" | 17 #include "chrome/browser/plugin_data_remover_helper.h" |
18 #include "chrome/browser/plugin_prefs.h" | 18 #include "chrome/browser/plugin_prefs.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/ui/browser_list.h" | 20 #include "chrome/browser/ui/browser_list.h" |
21 #include "chrome/common/extensions/extension.h" | 21 #include "chrome/common/extensions/extension.h" |
22 #include "chrome/common/extensions/extension_error_utils.h" | 22 #include "chrome/common/extensions/extension_error_utils.h" |
23 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
24 | 24 |
25 using content::BrowserThread; | 25 using content::BrowserThread; |
26 | 26 |
27 namespace keys = extension_clear_api_constants; | 27 namespace keys = extension_clear_api_constants; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } else { | 117 } else { |
118 StartRemoving(); | 118 StartRemoving(); |
119 } | 119 } |
120 | 120 |
121 // Will finish asynchronously. | 121 // Will finish asynchronously. |
122 return true; | 122 return true; |
123 } | 123 } |
124 | 124 |
125 void BrowsingDataExtensionFunction::CheckRemovingLSODataSupported( | 125 void BrowsingDataExtensionFunction::CheckRemovingLSODataSupported( |
126 scoped_refptr<PluginPrefs> plugin_prefs) { | 126 scoped_refptr<PluginPrefs> plugin_prefs) { |
127 if (!PluginDataRemover::IsSupported(plugin_prefs)) | 127 if (!PluginDataRemoverHelper::IsSupported(plugin_prefs)) |
128 removal_mask_ &= ~BrowsingDataRemover::REMOVE_LSO_DATA; | 128 removal_mask_ &= ~BrowsingDataRemover::REMOVE_LSO_DATA; |
129 | 129 |
130 BrowserThread::PostTask( | 130 BrowserThread::PostTask( |
131 BrowserThread::UI, FROM_HERE, | 131 BrowserThread::UI, FROM_HERE, |
132 base::Bind(&BrowsingDataExtensionFunction::StartRemoving, this)); | 132 base::Bind(&BrowsingDataExtensionFunction::StartRemoving, this)); |
133 } | 133 } |
134 | 134 |
135 void BrowsingDataExtensionFunction::StartRemoving() { | 135 void BrowsingDataExtensionFunction::StartRemoving() { |
136 // If we're good to go, add a ref (Balanced in OnBrowsingDataRemoverDone) | 136 // If we're good to go, add a ref (Balanced in OnBrowsingDataRemoverDone) |
137 AddRef(); | 137 AddRef(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 return BrowsingDataRemover::REMOVE_FORM_DATA; | 171 return BrowsingDataRemover::REMOVE_FORM_DATA; |
172 } | 172 } |
173 | 173 |
174 int ClearHistoryFunction::GetRemovalMask() const { | 174 int ClearHistoryFunction::GetRemovalMask() const { |
175 return BrowsingDataRemover::REMOVE_HISTORY; | 175 return BrowsingDataRemover::REMOVE_HISTORY; |
176 } | 176 } |
177 | 177 |
178 int ClearPasswordsFunction::GetRemovalMask() const { | 178 int ClearPasswordsFunction::GetRemovalMask() const { |
179 return BrowsingDataRemover::REMOVE_CACHE; | 179 return BrowsingDataRemover::REMOVE_CACHE; |
180 } | 180 } |
OLD | NEW |