| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 base::DictionaryValue* permitted_dict, | 211 base::DictionaryValue* permitted_dict, |
| 212 const char* data_type, | 212 const char* data_type, |
| 213 bool is_selected) { | 213 bool is_selected) { |
| 214 bool is_permitted = | 214 bool is_permitted = |
| 215 IsRemovalPermitted(MaskForKey(data_type), GetProfile()->GetPrefs()); | 215 IsRemovalPermitted(MaskForKey(data_type), GetProfile()->GetPrefs()); |
| 216 selected_dict->SetBoolean(data_type, is_selected && is_permitted); | 216 selected_dict->SetBoolean(data_type, is_selected && is_permitted); |
| 217 permitted_dict->SetBoolean(data_type, is_permitted); | 217 permitted_dict->SetBoolean(data_type, is_permitted); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void BrowsingDataRemoverFunction::OnBrowsingDataRemoverDone() { | 220 void BrowsingDataRemoverFunction::OnBrowsingDataRemoverDone() { |
| 221 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 221 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 222 this->SendResponse(true); | 222 this->SendResponse(true); |
| 223 | 223 |
| 224 Release(); // Balanced in RunImpl. | 224 Release(); // Balanced in RunImpl. |
| 225 } | 225 } |
| 226 | 226 |
| 227 bool BrowsingDataRemoverFunction::RunImpl() { | 227 bool BrowsingDataRemoverFunction::RunImpl() { |
| 228 // If we don't have a profile, something's pretty wrong. | 228 // If we don't have a profile, something's pretty wrong. |
| 229 DCHECK(GetProfile()); | 229 DCHECK(GetProfile()); |
| 230 | 230 |
| 231 // Grab the initial |options| parameter, and parse out the arguments. | 231 // Grab the initial |options| parameter, and parse out the arguments. |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; | 416 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; |
| 417 } | 417 } |
| 418 | 418 |
| 419 int BrowsingDataRemovePasswordsFunction::GetRemovalMask() { | 419 int BrowsingDataRemovePasswordsFunction::GetRemovalMask() { |
| 420 return BrowsingDataRemover::REMOVE_PASSWORDS; | 420 return BrowsingDataRemover::REMOVE_PASSWORDS; |
| 421 } | 421 } |
| 422 | 422 |
| 423 int BrowsingDataRemoveWebSQLFunction::GetRemovalMask() { | 423 int BrowsingDataRemoveWebSQLFunction::GetRemovalMask() { |
| 424 return BrowsingDataRemover::REMOVE_WEBSQL; | 424 return BrowsingDataRemover::REMOVE_WEBSQL; |
| 425 } | 425 } |
| OLD | NEW |