OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 BrowsingData API functions, which entail | 5 // Defines the Chrome Extensions BrowsingData 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 the extension API JSON. | 7 // honest, are the same thing), as specified in the extension API JSON. |
8 | 8 |
9 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h" | 9 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h" |
10 | 10 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 } else { | 148 } else { |
149 StartRemoving(); | 149 StartRemoving(); |
150 } | 150 } |
151 | 151 |
152 // Will finish asynchronously. | 152 // Will finish asynchronously. |
153 return true; | 153 return true; |
154 } | 154 } |
155 | 155 |
156 void BrowsingDataExtensionFunction::CheckRemovingPluginDataSupported( | 156 void BrowsingDataExtensionFunction::CheckRemovingPluginDataSupported( |
157 scoped_refptr<PluginPrefs> plugin_prefs) { | 157 scoped_refptr<PluginPrefs> plugin_prefs) { |
158 if (!PluginDataRemoverHelper::IsSupported(plugin_prefs)) | 158 if (!PluginDataRemoverHelper::IsSupported(plugin_prefs.get())) |
159 removal_mask_ &= ~BrowsingDataRemover::REMOVE_PLUGIN_DATA; | 159 removal_mask_ &= ~BrowsingDataRemover::REMOVE_PLUGIN_DATA; |
160 | 160 |
161 BrowserThread::PostTask( | 161 BrowserThread::PostTask( |
162 BrowserThread::UI, FROM_HERE, | 162 BrowserThread::UI, FROM_HERE, |
163 base::Bind(&BrowsingDataExtensionFunction::StartRemoving, this)); | 163 base::Bind(&BrowsingDataExtensionFunction::StartRemoving, this)); |
164 } | 164 } |
165 | 165 |
166 void BrowsingDataExtensionFunction::StartRemoving() { | 166 void BrowsingDataExtensionFunction::StartRemoving() { |
167 if (BrowsingDataRemover::is_removing()) { | 167 if (BrowsingDataRemover::is_removing()) { |
168 error_ = extension_browsing_data_api_constants::kOneAtATimeError; | 168 error_ = extension_browsing_data_api_constants::kOneAtATimeError; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; | 273 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; |
274 } | 274 } |
275 | 275 |
276 int RemovePasswordsFunction::GetRemovalMask() const { | 276 int RemovePasswordsFunction::GetRemovalMask() const { |
277 return BrowsingDataRemover::REMOVE_PASSWORDS; | 277 return BrowsingDataRemover::REMOVE_PASSWORDS; |
278 } | 278 } |
279 | 279 |
280 int RemoveWebSQLFunction::GetRemovalMask() const { | 280 int RemoveWebSQLFunction::GetRemovalMask() const { |
281 return BrowsingDataRemover::REMOVE_WEBSQL; | 281 return BrowsingDataRemover::REMOVE_WEBSQL; |
282 } | 282 } |
OLD | NEW |