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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // download history. | 105 // download history. |
106 if ((removal_mask & BrowsingDataRemover::REMOVE_HISTORY) || | 106 if ((removal_mask & BrowsingDataRemover::REMOVE_HISTORY) || |
107 (removal_mask & BrowsingDataRemover::REMOVE_DOWNLOADS)) { | 107 (removal_mask & BrowsingDataRemover::REMOVE_DOWNLOADS)) { |
108 return prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); | 108 return prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); |
109 } | 109 } |
110 return true; | 110 return true; |
111 } | 111 } |
112 | 112 |
113 } // namespace | 113 } // namespace |
114 | 114 |
115 | 115 bool BrowsingDataSettingsFunction::RunSync() { |
116 bool BrowsingDataSettingsFunction::RunImpl() { | |
117 PrefService* prefs = GetProfile()->GetPrefs(); | 116 PrefService* prefs = GetProfile()->GetPrefs(); |
118 | 117 |
119 // Fill origin types. | 118 // Fill origin types. |
120 // The "cookies" and "hosted apps" UI checkboxes both map to | 119 // The "cookies" and "hosted apps" UI checkboxes both map to |
121 // REMOVE_SITE_DATA in browsing_data_remover.h, the former for the unprotected | 120 // REMOVE_SITE_DATA in browsing_data_remover.h, the former for the unprotected |
122 // web, the latter for protected web data. There is no UI control for | 121 // web, the latter for protected web data. There is no UI control for |
123 // extension data. | 122 // extension data. |
124 scoped_ptr<base::DictionaryValue> origin_types(new base::DictionaryValue); | 123 scoped_ptr<base::DictionaryValue> origin_types(new base::DictionaryValue); |
125 origin_types->SetBoolean( | 124 origin_types->SetBoolean( |
126 extension_browsing_data_api_constants::kUnprotectedWebKey, | 125 extension_browsing_data_api_constants::kUnprotectedWebKey, |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; | 415 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; |
417 } | 416 } |
418 | 417 |
419 int BrowsingDataRemovePasswordsFunction::GetRemovalMask() { | 418 int BrowsingDataRemovePasswordsFunction::GetRemovalMask() { |
420 return BrowsingDataRemover::REMOVE_PASSWORDS; | 419 return BrowsingDataRemover::REMOVE_PASSWORDS; |
421 } | 420 } |
422 | 421 |
423 int BrowsingDataRemoveWebSQLFunction::GetRemovalMask() { | 422 int BrowsingDataRemoveWebSQLFunction::GetRemovalMask() { |
424 return BrowsingDataRemover::REMOVE_WEBSQL; | 423 return BrowsingDataRemover::REMOVE_WEBSQL; |
425 } | 424 } |
OLD | NEW |