| 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 16 matching lines...) Expand all Loading... |
| 27 // Type Keys. | 27 // Type Keys. |
| 28 const char kAppCacheKey[] = "appcache"; | 28 const char kAppCacheKey[] = "appcache"; |
| 29 const char kCacheKey[] = "cache"; | 29 const char kCacheKey[] = "cache"; |
| 30 const char kCookiesKey[] = "cookies"; | 30 const char kCookiesKey[] = "cookies"; |
| 31 const char kDownloadsKey[] = "downloads"; | 31 const char kDownloadsKey[] = "downloads"; |
| 32 const char kFileSystemsKey[] = "fileSystems"; | 32 const char kFileSystemsKey[] = "fileSystems"; |
| 33 const char kFormDataKey[] = "formData"; | 33 const char kFormDataKey[] = "formData"; |
| 34 const char kHistoryKey[] = "history"; | 34 const char kHistoryKey[] = "history"; |
| 35 const char kIndexedDBKey[] = "indexedDB"; | 35 const char kIndexedDBKey[] = "indexedDB"; |
| 36 const char kLocalStorageKey[] = "localStorage"; | 36 const char kLocalStorageKey[] = "localStorage"; |
| 37 const char kOriginBoundCertsKey[] = "originBoundCerts"; | 37 const char kServerBoundCertsKey[] = "serverBoundCerts"; |
| 38 const char kPasswordsKey[] = "passwords"; | 38 const char kPasswordsKey[] = "passwords"; |
| 39 const char kPluginDataKey[] = "pluginData"; | 39 const char kPluginDataKey[] = "pluginData"; |
| 40 const char kWebSQLKey[] = "webSQL"; | 40 const char kWebSQLKey[] = "webSQL"; |
| 41 | 41 |
| 42 // Option Keys. | 42 // Option Keys. |
| 43 const char kSinceKey[] = "since"; | 43 const char kSinceKey[] = "since"; |
| 44 | 44 |
| 45 // Errors! | 45 // Errors! |
| 46 const char kOneAtATimeError[] = "Only one 'browsingData' API call can run at" | 46 const char kOneAtATimeError[] = "Only one 'browsingData' API call can run at" |
| 47 "a time."; | 47 "a time."; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 if (RemoveType(value, extension_browsing_data_api_constants::kFormDataKey)) | 82 if (RemoveType(value, extension_browsing_data_api_constants::kFormDataKey)) |
| 83 GetRemovalMask |= BrowsingDataRemover::REMOVE_FORM_DATA; | 83 GetRemovalMask |= BrowsingDataRemover::REMOVE_FORM_DATA; |
| 84 if (RemoveType(value, extension_browsing_data_api_constants::kHistoryKey)) | 84 if (RemoveType(value, extension_browsing_data_api_constants::kHistoryKey)) |
| 85 GetRemovalMask |= BrowsingDataRemover::REMOVE_HISTORY; | 85 GetRemovalMask |= BrowsingDataRemover::REMOVE_HISTORY; |
| 86 if (RemoveType(value, extension_browsing_data_api_constants::kIndexedDBKey)) | 86 if (RemoveType(value, extension_browsing_data_api_constants::kIndexedDBKey)) |
| 87 GetRemovalMask |= BrowsingDataRemover::REMOVE_INDEXEDDB; | 87 GetRemovalMask |= BrowsingDataRemover::REMOVE_INDEXEDDB; |
| 88 if (RemoveType(value, | 88 if (RemoveType(value, |
| 89 extension_browsing_data_api_constants::kLocalStorageKey)) | 89 extension_browsing_data_api_constants::kLocalStorageKey)) |
| 90 GetRemovalMask |= BrowsingDataRemover::REMOVE_LOCAL_STORAGE; | 90 GetRemovalMask |= BrowsingDataRemover::REMOVE_LOCAL_STORAGE; |
| 91 if (RemoveType(value, | 91 if (RemoveType(value, |
| 92 extension_browsing_data_api_constants::kOriginBoundCertsKey)) | 92 extension_browsing_data_api_constants::kServerBoundCertsKey)) |
| 93 GetRemovalMask |= BrowsingDataRemover::REMOVE_ORIGIN_BOUND_CERTS; | 93 GetRemovalMask |= BrowsingDataRemover::REMOVE_SERVER_BOUND_CERTS; |
| 94 if (RemoveType(value, extension_browsing_data_api_constants::kPasswordsKey)) | 94 if (RemoveType(value, extension_browsing_data_api_constants::kPasswordsKey)) |
| 95 GetRemovalMask |= BrowsingDataRemover::REMOVE_PASSWORDS; | 95 GetRemovalMask |= BrowsingDataRemover::REMOVE_PASSWORDS; |
| 96 if (RemoveType(value, extension_browsing_data_api_constants::kPluginDataKey)) | 96 if (RemoveType(value, extension_browsing_data_api_constants::kPluginDataKey)) |
| 97 GetRemovalMask |= BrowsingDataRemover::REMOVE_PLUGIN_DATA; | 97 GetRemovalMask |= BrowsingDataRemover::REMOVE_PLUGIN_DATA; |
| 98 if (RemoveType(value, extension_browsing_data_api_constants::kWebSQLKey)) | 98 if (RemoveType(value, extension_browsing_data_api_constants::kWebSQLKey)) |
| 99 GetRemovalMask |= BrowsingDataRemover::REMOVE_WEBSQL; | 99 GetRemovalMask |= BrowsingDataRemover::REMOVE_WEBSQL; |
| 100 | 100 |
| 101 return GetRemovalMask; | 101 return GetRemovalMask; |
| 102 } | 102 } |
| 103 | 103 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 } | 217 } |
| 218 | 218 |
| 219 int RemoveIndexedDBFunction::GetRemovalMask() const { | 219 int RemoveIndexedDBFunction::GetRemovalMask() const { |
| 220 return BrowsingDataRemover::REMOVE_INDEXEDDB; | 220 return BrowsingDataRemover::REMOVE_INDEXEDDB; |
| 221 } | 221 } |
| 222 | 222 |
| 223 int RemoveLocalStorageFunction::GetRemovalMask() const { | 223 int RemoveLocalStorageFunction::GetRemovalMask() const { |
| 224 return BrowsingDataRemover::REMOVE_LOCAL_STORAGE; | 224 return BrowsingDataRemover::REMOVE_LOCAL_STORAGE; |
| 225 } | 225 } |
| 226 | 226 |
| 227 int RemoveOriginBoundCertsFunction::GetRemovalMask() const { | 227 int RemoveServerBoundCertsFunction::GetRemovalMask() const { |
| 228 return BrowsingDataRemover::REMOVE_ORIGIN_BOUND_CERTS; | 228 return BrowsingDataRemover::REMOVE_SERVER_BOUND_CERTS; |
| 229 } | 229 } |
| 230 | 230 |
| 231 int RemovePluginDataFunction::GetRemovalMask() const { | 231 int RemovePluginDataFunction::GetRemovalMask() const { |
| 232 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; | 232 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; |
| 233 } | 233 } |
| 234 | 234 |
| 235 int RemovePasswordsFunction::GetRemovalMask() const { | 235 int RemovePasswordsFunction::GetRemovalMask() const { |
| 236 return BrowsingDataRemover::REMOVE_PASSWORDS; | 236 return BrowsingDataRemover::REMOVE_PASSWORDS; |
| 237 } | 237 } |
| 238 | 238 |
| 239 int RemoveWebSQLFunction::GetRemovalMask() const { | 239 int RemoveWebSQLFunction::GetRemovalMask() const { |
| 240 return BrowsingDataRemover::REMOVE_WEBSQL; | 240 return BrowsingDataRemover::REMOVE_WEBSQL; |
| 241 } | 241 } |
| OLD | NEW |