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