| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 } // namespace extension_browsing_data_api_constants | 71 } // namespace extension_browsing_data_api_constants |
| 72 | 72 |
| 73 namespace { | 73 namespace { |
| 74 int MaskForKey(const char* key) { | 74 int MaskForKey(const char* key) { |
| 75 if (strcmp(key, extension_browsing_data_api_constants::kAppCacheKey) == 0) | 75 if (strcmp(key, extension_browsing_data_api_constants::kAppCacheKey) == 0) |
| 76 return BrowsingDataRemover::REMOVE_APPCACHE; | 76 return BrowsingDataRemover::REMOVE_APPCACHE; |
| 77 if (strcmp(key, extension_browsing_data_api_constants::kCacheKey) == 0) | 77 if (strcmp(key, extension_browsing_data_api_constants::kCacheKey) == 0) |
| 78 return BrowsingDataRemover::REMOVE_CACHE; | 78 return BrowsingDataRemover::REMOVE_CACHE; |
| 79 if (strcmp(key, extension_browsing_data_api_constants::kCookiesKey) == 0) { | 79 if (strcmp(key, extension_browsing_data_api_constants::kCookiesKey) == 0) { |
| 80 return BrowsingDataRemover::REMOVE_COOKIES | | 80 return BrowsingDataRemover::REMOVE_COOKIES; |
| 81 BrowsingDataRemover::REMOVE_WEBRTC_IDENTITY; | |
| 82 } | 81 } |
| 83 if (strcmp(key, extension_browsing_data_api_constants::kDownloadsKey) == 0) | 82 if (strcmp(key, extension_browsing_data_api_constants::kDownloadsKey) == 0) |
| 84 return BrowsingDataRemover::REMOVE_DOWNLOADS; | 83 return BrowsingDataRemover::REMOVE_DOWNLOADS; |
| 85 if (strcmp(key, extension_browsing_data_api_constants::kFileSystemsKey) == 0) | 84 if (strcmp(key, extension_browsing_data_api_constants::kFileSystemsKey) == 0) |
| 86 return BrowsingDataRemover::REMOVE_FILE_SYSTEMS; | 85 return BrowsingDataRemover::REMOVE_FILE_SYSTEMS; |
| 87 if (strcmp(key, extension_browsing_data_api_constants::kFormDataKey) == 0) | 86 if (strcmp(key, extension_browsing_data_api_constants::kFormDataKey) == 0) |
| 88 return BrowsingDataRemover::REMOVE_FORM_DATA; | 87 return BrowsingDataRemover::REMOVE_FORM_DATA; |
| 89 if (strcmp(key, extension_browsing_data_api_constants::kHistoryKey) == 0) | 88 if (strcmp(key, extension_browsing_data_api_constants::kHistoryKey) == 0) |
| 90 return BrowsingDataRemover::REMOVE_HISTORY; | 89 return BrowsingDataRemover::REMOVE_HISTORY; |
| 91 if (strcmp(key, extension_browsing_data_api_constants::kIndexedDBKey) == 0) | 90 if (strcmp(key, extension_browsing_data_api_constants::kIndexedDBKey) == 0) |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 int BrowsingDataRemoveAppcacheFunction::GetRemovalMask() { | 404 int BrowsingDataRemoveAppcacheFunction::GetRemovalMask() { |
| 406 return BrowsingDataRemover::REMOVE_APPCACHE; | 405 return BrowsingDataRemover::REMOVE_APPCACHE; |
| 407 } | 406 } |
| 408 | 407 |
| 409 int BrowsingDataRemoveCacheFunction::GetRemovalMask() { | 408 int BrowsingDataRemoveCacheFunction::GetRemovalMask() { |
| 410 return BrowsingDataRemover::REMOVE_CACHE; | 409 return BrowsingDataRemover::REMOVE_CACHE; |
| 411 } | 410 } |
| 412 | 411 |
| 413 int BrowsingDataRemoveCookiesFunction::GetRemovalMask() { | 412 int BrowsingDataRemoveCookiesFunction::GetRemovalMask() { |
| 414 return BrowsingDataRemover::REMOVE_COOKIES | | 413 return BrowsingDataRemover::REMOVE_COOKIES | |
| 415 BrowsingDataRemover::REMOVE_CHANNEL_IDS | | 414 BrowsingDataRemover::REMOVE_CHANNEL_IDS; |
| 416 BrowsingDataRemover::REMOVE_WEBRTC_IDENTITY; | |
| 417 } | 415 } |
| 418 | 416 |
| 419 int BrowsingDataRemoveDownloadsFunction::GetRemovalMask() { | 417 int BrowsingDataRemoveDownloadsFunction::GetRemovalMask() { |
| 420 return BrowsingDataRemover::REMOVE_DOWNLOADS; | 418 return BrowsingDataRemover::REMOVE_DOWNLOADS; |
| 421 } | 419 } |
| 422 | 420 |
| 423 int BrowsingDataRemoveFileSystemsFunction::GetRemovalMask() { | 421 int BrowsingDataRemoveFileSystemsFunction::GetRemovalMask() { |
| 424 return BrowsingDataRemover::REMOVE_FILE_SYSTEMS; | 422 return BrowsingDataRemover::REMOVE_FILE_SYSTEMS; |
| 425 } | 423 } |
| 426 | 424 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 452 return BrowsingDataRemover::REMOVE_SERVICE_WORKERS; | 450 return BrowsingDataRemover::REMOVE_SERVICE_WORKERS; |
| 453 } | 451 } |
| 454 | 452 |
| 455 int BrowsingDataRemoveCacheStorageFunction::GetRemovalMask() { | 453 int BrowsingDataRemoveCacheStorageFunction::GetRemovalMask() { |
| 456 return BrowsingDataRemover::REMOVE_CACHE_STORAGE; | 454 return BrowsingDataRemover::REMOVE_CACHE_STORAGE; |
| 457 } | 455 } |
| 458 | 456 |
| 459 int BrowsingDataRemoveWebSQLFunction::GetRemovalMask() { | 457 int BrowsingDataRemoveWebSQLFunction::GetRemovalMask() { |
| 460 return BrowsingDataRemover::REMOVE_WEBSQL; | 458 return BrowsingDataRemover::REMOVE_WEBSQL; |
| 461 } | 459 } |
| OLD | NEW |