| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 if (d->HasKey(extension_browsing_data_api_constants::kExtensionsKey)) { | 216 if (d->HasKey(extension_browsing_data_api_constants::kExtensionsKey)) { |
| 217 EXTENSION_FUNCTION_VALIDATE(d->GetBoolean( | 217 EXTENSION_FUNCTION_VALIDATE(d->GetBoolean( |
| 218 extension_browsing_data_api_constants::kExtensionsKey, &value)); | 218 extension_browsing_data_api_constants::kExtensionsKey, &value)); |
| 219 mask |= value ? BrowsingDataHelper::EXTENSION : 0; | 219 mask |= value ? BrowsingDataHelper::EXTENSION : 0; |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 | 222 |
| 223 return mask; | 223 return mask; |
| 224 } | 224 } |
| 225 | 225 |
| 226 int RemoveBrowsingDataFunction::GetRemovalMask() const { | 226 int BrowsingDataRemoveFunction::GetRemovalMask() const { |
| 227 // Parse the |dataToRemove| argument to generate the removal mask. | 227 // Parse the |dataToRemove| argument to generate the removal mask. |
| 228 base::DictionaryValue* data_to_remove; | 228 base::DictionaryValue* data_to_remove; |
| 229 if (args_->GetDictionary(1, &data_to_remove)) | 229 if (args_->GetDictionary(1, &data_to_remove)) |
| 230 return ParseRemovalMask(data_to_remove); | 230 return ParseRemovalMask(data_to_remove); |
| 231 else | 231 else |
| 232 return 0; | 232 return 0; |
| 233 } | 233 } |
| 234 | 234 |
| 235 int RemoveAppCacheFunction::GetRemovalMask() const { | 235 int BrowsingDataRemoveAppcacheFunction::GetRemovalMask() const { |
| 236 return BrowsingDataRemover::REMOVE_APPCACHE; | 236 return BrowsingDataRemover::REMOVE_APPCACHE; |
| 237 } | 237 } |
| 238 | 238 |
| 239 int RemoveCacheFunction::GetRemovalMask() const { | 239 int BrowsingDataRemoveCacheFunction::GetRemovalMask() const { |
| 240 return BrowsingDataRemover::REMOVE_CACHE; | 240 return BrowsingDataRemover::REMOVE_CACHE; |
| 241 } | 241 } |
| 242 | 242 |
| 243 int RemoveCookiesFunction::GetRemovalMask() const { | 243 int BrowsingDataRemoveCookiesFunction::GetRemovalMask() const { |
| 244 return BrowsingDataRemover::REMOVE_COOKIES | | 244 return BrowsingDataRemover::REMOVE_COOKIES | |
| 245 BrowsingDataRemover::REMOVE_SERVER_BOUND_CERTS; | 245 BrowsingDataRemover::REMOVE_SERVER_BOUND_CERTS; |
| 246 } | 246 } |
| 247 | 247 |
| 248 int RemoveDownloadsFunction::GetRemovalMask() const { | 248 int BrowsingDataRemoveDownloadsFunction::GetRemovalMask() const { |
| 249 return BrowsingDataRemover::REMOVE_DOWNLOADS; | 249 return BrowsingDataRemover::REMOVE_DOWNLOADS; |
| 250 } | 250 } |
| 251 | 251 |
| 252 int RemoveFileSystemsFunction::GetRemovalMask() const { | 252 int BrowsingDataRemoveFileSystemsFunction::GetRemovalMask() const { |
| 253 return BrowsingDataRemover::REMOVE_FILE_SYSTEMS; | 253 return BrowsingDataRemover::REMOVE_FILE_SYSTEMS; |
| 254 } | 254 } |
| 255 | 255 |
| 256 int RemoveFormDataFunction::GetRemovalMask() const { | 256 int BrowsingDataRemoveFormDataFunction::GetRemovalMask() const { |
| 257 return BrowsingDataRemover::REMOVE_FORM_DATA; | 257 return BrowsingDataRemover::REMOVE_FORM_DATA; |
| 258 } | 258 } |
| 259 | 259 |
| 260 int RemoveHistoryFunction::GetRemovalMask() const { | 260 int BrowsingDataRemoveHistoryFunction::GetRemovalMask() const { |
| 261 return BrowsingDataRemover::REMOVE_HISTORY; | 261 return BrowsingDataRemover::REMOVE_HISTORY; |
| 262 } | 262 } |
| 263 | 263 |
| 264 int RemoveIndexedDBFunction::GetRemovalMask() const { | 264 int BrowsingDataRemoveIndexedDBFunction::GetRemovalMask() const { |
| 265 return BrowsingDataRemover::REMOVE_INDEXEDDB; | 265 return BrowsingDataRemover::REMOVE_INDEXEDDB; |
| 266 } | 266 } |
| 267 | 267 |
| 268 int RemoveLocalStorageFunction::GetRemovalMask() const { | 268 int BrowsingDataRemoveLocalStorageFunction::GetRemovalMask() const { |
| 269 return BrowsingDataRemover::REMOVE_LOCAL_STORAGE; | 269 return BrowsingDataRemover::REMOVE_LOCAL_STORAGE; |
| 270 } | 270 } |
| 271 | 271 |
| 272 int RemovePluginDataFunction::GetRemovalMask() const { | 272 int BrowsingDataRemovePluginDataFunction::GetRemovalMask() const { |
| 273 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; | 273 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; |
| 274 } | 274 } |
| 275 | 275 |
| 276 int RemovePasswordsFunction::GetRemovalMask() const { | 276 int BrowsingDataRemovePasswordsFunction::GetRemovalMask() const { |
| 277 return BrowsingDataRemover::REMOVE_PASSWORDS; | 277 return BrowsingDataRemover::REMOVE_PASSWORDS; |
| 278 } | 278 } |
| 279 | 279 |
| 280 int RemoveWebSQLFunction::GetRemovalMask() const { | 280 int BrowsingDataRemoveWebSQLFunction::GetRemovalMask() const { |
| 281 return BrowsingDataRemover::REMOVE_WEBSQL; | 281 return BrowsingDataRemover::REMOVE_WEBSQL; |
| 282 } | 282 } |
| OLD | NEW |