| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 remover->AddObserver(this); | 185 remover->AddObserver(this); |
| 186 remover->Remove(removal_mask_, origin_set_mask_); | 186 remover->Remove(removal_mask_, origin_set_mask_); |
| 187 } | 187 } |
| 188 | 188 |
| 189 int BrowsingDataExtensionFunction::ParseOriginSetMask( | 189 int BrowsingDataExtensionFunction::ParseOriginSetMask( |
| 190 const base::DictionaryValue& options) { | 190 const base::DictionaryValue& options) { |
| 191 // Parse the |options| dictionary to generate the origin set mask. Default to | 191 // Parse the |options| dictionary to generate the origin set mask. Default to |
| 192 // UNPROTECTED_WEB if the developer doesn't specify anything. | 192 // UNPROTECTED_WEB if the developer doesn't specify anything. |
| 193 int mask = BrowsingDataHelper::UNPROTECTED_WEB; | 193 int mask = BrowsingDataHelper::UNPROTECTED_WEB; |
| 194 | 194 |
| 195 DictionaryValue* d = NULL; | 195 const DictionaryValue* d = NULL; |
| 196 if (options.HasKey(extension_browsing_data_api_constants::kOriginTypesKey)) { | 196 if (options.HasKey(extension_browsing_data_api_constants::kOriginTypesKey)) { |
| 197 EXTENSION_FUNCTION_VALIDATE(options.GetDictionary( | 197 EXTENSION_FUNCTION_VALIDATE(options.GetDictionary( |
| 198 extension_browsing_data_api_constants::kOriginTypesKey, &d)); | 198 extension_browsing_data_api_constants::kOriginTypesKey, &d)); |
| 199 bool value; | 199 bool value; |
| 200 | 200 |
| 201 // The developer specified something! Reset to 0 and parse the dictionary. | 201 // The developer specified something! Reset to 0 and parse the dictionary. |
| 202 mask = 0; | 202 mask = 0; |
| 203 | 203 |
| 204 // Unprotected web. | 204 // Unprotected web. |
| 205 if (d->HasKey(extension_browsing_data_api_constants::kUnprotectedWebKey)) { | 205 if (d->HasKey(extension_browsing_data_api_constants::kUnprotectedWebKey)) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; | 279 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; |
| 280 } | 280 } |
| 281 | 281 |
| 282 int RemovePasswordsFunction::GetRemovalMask() const { | 282 int RemovePasswordsFunction::GetRemovalMask() const { |
| 283 return BrowsingDataRemover::REMOVE_PASSWORDS; | 283 return BrowsingDataRemover::REMOVE_PASSWORDS; |
| 284 } | 284 } |
| 285 | 285 |
| 286 int RemoveWebSQLFunction::GetRemovalMask() const { | 286 int RemoveWebSQLFunction::GetRemovalMask() const { |
| 287 return BrowsingDataRemover::REMOVE_WEBSQL; | 287 return BrowsingDataRemover::REMOVE_WEBSQL; |
| 288 } | 288 } |
| OLD | NEW |