| 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 |
| 11 #include <string> | 11 #include <string> |
| 12 #include <utility> | 12 #include <utility> |
| 13 | 13 |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 15 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 16 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 16 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 17 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" | 17 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" |
| 18 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" |
| 18 #include "chrome/browser/plugins/plugin_data_remover_helper.h" | 19 #include "chrome/browser/plugins/plugin_data_remover_helper.h" |
| 19 #include "chrome/browser/plugins/plugin_prefs.h" | 20 #include "chrome/browser/plugins/plugin_prefs.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
| 22 #include "chrome/common/pref_names.h" | 23 #include "chrome/common/pref_names.h" |
| 23 #include "components/browsing_data/core/browsing_data_utils.h" | 24 #include "components/browsing_data/core/browsing_data_utils.h" |
| 24 #include "components/browsing_data/core/pref_names.h" | 25 #include "components/browsing_data/core/pref_names.h" |
| 25 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
| 26 #include "extensions/common/error_utils.h" | 27 #include "extensions/common/error_utils.h" |
| 27 #include "extensions/common/extension.h" | 28 #include "extensions/common/extension.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // "history"). | 65 // "history"). |
| 65 const char kBadDataTypeDetails[] = "Invalid value for data type '%s'."; | 66 const char kBadDataTypeDetails[] = "Invalid value for data type '%s'."; |
| 66 const char kDeleteProhibitedError[] = "Browsing history and downloads are not " | 67 const char kDeleteProhibitedError[] = "Browsing history and downloads are not " |
| 67 "permitted to be removed."; | 68 "permitted to be removed."; |
| 68 | 69 |
| 69 } // namespace extension_browsing_data_api_constants | 70 } // namespace extension_browsing_data_api_constants |
| 70 | 71 |
| 71 namespace { | 72 namespace { |
| 72 int MaskForKey(const char* key) { | 73 int MaskForKey(const char* key) { |
| 73 if (strcmp(key, extension_browsing_data_api_constants::kAppCacheKey) == 0) | 74 if (strcmp(key, extension_browsing_data_api_constants::kAppCacheKey) == 0) |
| 74 return BrowsingDataRemover::REMOVE_APPCACHE; | 75 return BrowsingDataRemover::DATA_TYPE_APP_CACHE; |
| 75 if (strcmp(key, extension_browsing_data_api_constants::kCacheKey) == 0) | 76 if (strcmp(key, extension_browsing_data_api_constants::kCacheKey) == 0) |
| 76 return BrowsingDataRemover::REMOVE_CACHE; | 77 return BrowsingDataRemover::DATA_TYPE_CACHE; |
| 77 if (strcmp(key, extension_browsing_data_api_constants::kCookiesKey) == 0) { | 78 if (strcmp(key, extension_browsing_data_api_constants::kCookiesKey) == 0) { |
| 78 return BrowsingDataRemover::REMOVE_COOKIES; | 79 return BrowsingDataRemover::DATA_TYPE_COOKIES; |
| 79 } | 80 } |
| 80 if (strcmp(key, extension_browsing_data_api_constants::kDownloadsKey) == 0) | 81 if (strcmp(key, extension_browsing_data_api_constants::kDownloadsKey) == 0) |
| 81 return BrowsingDataRemover::REMOVE_DOWNLOADS; | 82 return BrowsingDataRemover::DATA_TYPE_DOWNLOADS; |
| 82 if (strcmp(key, extension_browsing_data_api_constants::kFileSystemsKey) == 0) | 83 if (strcmp(key, extension_browsing_data_api_constants::kFileSystemsKey) == 0) |
| 83 return BrowsingDataRemover::REMOVE_FILE_SYSTEMS; | 84 return BrowsingDataRemover::DATA_TYPE_FILE_SYSTEMS; |
| 84 if (strcmp(key, extension_browsing_data_api_constants::kFormDataKey) == 0) | 85 if (strcmp(key, extension_browsing_data_api_constants::kFormDataKey) == 0) |
| 85 return BrowsingDataRemover::REMOVE_FORM_DATA; | 86 return ChromeBrowsingDataRemoverDelegate::DATA_TYPE_FORM_DATA; |
| 86 if (strcmp(key, extension_browsing_data_api_constants::kHistoryKey) == 0) | 87 if (strcmp(key, extension_browsing_data_api_constants::kHistoryKey) == 0) |
| 87 return BrowsingDataRemover::REMOVE_HISTORY; | 88 return ChromeBrowsingDataRemoverDelegate::DATA_TYPE_HISTORY; |
| 88 if (strcmp(key, extension_browsing_data_api_constants::kIndexedDBKey) == 0) | 89 if (strcmp(key, extension_browsing_data_api_constants::kIndexedDBKey) == 0) |
| 89 return BrowsingDataRemover::REMOVE_INDEXEDDB; | 90 return BrowsingDataRemover::DATA_TYPE_INDEXED_DB; |
| 90 if (strcmp(key, extension_browsing_data_api_constants::kLocalStorageKey) == 0) | 91 if (strcmp(key, extension_browsing_data_api_constants::kLocalStorageKey) == 0) |
| 91 return BrowsingDataRemover::REMOVE_LOCAL_STORAGE; | 92 return BrowsingDataRemover::DATA_TYPE_LOCAL_STORAGE; |
| 92 if (strcmp(key, | 93 if (strcmp(key, |
| 93 extension_browsing_data_api_constants::kChannelIDsKey) == 0) | 94 extension_browsing_data_api_constants::kChannelIDsKey) == 0) |
| 94 return BrowsingDataRemover::REMOVE_CHANNEL_IDS; | 95 return BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS; |
| 95 if (strcmp(key, extension_browsing_data_api_constants::kPasswordsKey) == 0) | 96 if (strcmp(key, extension_browsing_data_api_constants::kPasswordsKey) == 0) |
| 96 return BrowsingDataRemover::REMOVE_PASSWORDS; | 97 return ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PASSWORDS; |
| 97 if (strcmp(key, extension_browsing_data_api_constants::kPluginDataKey) == 0) | 98 if (strcmp(key, extension_browsing_data_api_constants::kPluginDataKey) == 0) |
| 98 return BrowsingDataRemover::REMOVE_PLUGIN_DATA; | 99 return ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA; |
| 99 if (strcmp(key, extension_browsing_data_api_constants::kServiceWorkersKey) == | 100 if (strcmp(key, extension_browsing_data_api_constants::kServiceWorkersKey) == |
| 100 0) | 101 0) |
| 101 return BrowsingDataRemover::REMOVE_SERVICE_WORKERS; | 102 return BrowsingDataRemover::DATA_TYPE_SERVICE_WORKERS; |
| 102 if (strcmp(key, extension_browsing_data_api_constants::kCacheStorageKey) == 0) | 103 if (strcmp(key, extension_browsing_data_api_constants::kCacheStorageKey) == 0) |
| 103 return BrowsingDataRemover::REMOVE_CACHE_STORAGE; | 104 return BrowsingDataRemover::DATA_TYPE_CACHE_STORAGE; |
| 104 if (strcmp(key, extension_browsing_data_api_constants::kWebSQLKey) == 0) | 105 if (strcmp(key, extension_browsing_data_api_constants::kWebSQLKey) == 0) |
| 105 return BrowsingDataRemover::REMOVE_WEBSQL; | 106 return BrowsingDataRemover::DATA_TYPE_WEB_SQL; |
| 106 | 107 |
| 107 return 0; | 108 return 0; |
| 108 } | 109 } |
| 109 | 110 |
| 110 // Returns false if any of the selected data types are not allowed to be | 111 // Returns false if any of the selected data types are not allowed to be |
| 111 // deleted. | 112 // deleted. |
| 112 bool IsRemovalPermitted(int removal_mask, PrefService* prefs) { | 113 bool IsRemovalPermitted(int removal_mask, PrefService* prefs) { |
| 113 // Enterprise policy or user preference might prohibit deleting browser or | 114 // Enterprise policy or user preference might prohibit deleting browser or |
| 114 // download history. | 115 // download history. |
| 115 if ((removal_mask & BrowsingDataRemover::REMOVE_HISTORY) || | 116 if ((removal_mask & ChromeBrowsingDataRemoverDelegate::DATA_TYPE_HISTORY) || |
| 116 (removal_mask & BrowsingDataRemover::REMOVE_DOWNLOADS)) { | 117 (removal_mask & BrowsingDataRemover::DATA_TYPE_DOWNLOADS)) { |
| 117 return prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); | 118 return prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); |
| 118 } | 119 } |
| 119 return true; | 120 return true; |
| 120 } | 121 } |
| 121 | 122 |
| 122 } // namespace | 123 } // namespace |
| 123 | 124 |
| 124 ExtensionFunction::ResponseAction BrowsingDataSettingsFunction::Run() { | 125 ExtensionFunction::ResponseAction BrowsingDataSettingsFunction::Run() { |
| 125 prefs_ = Profile::FromBrowserContext(browser_context())->GetPrefs(); | 126 prefs_ = Profile::FromBrowserContext(browser_context())->GetPrefs(); |
| 126 | 127 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 base::Time::FromDoubleT(ms_since_epoch / 1000.0); | 272 base::Time::FromDoubleT(ms_since_epoch / 1000.0); |
| 272 | 273 |
| 273 EXTENSION_FUNCTION_VALIDATE(GetRemovalMask(&removal_mask_)); | 274 EXTENSION_FUNCTION_VALIDATE(GetRemovalMask(&removal_mask_)); |
| 274 | 275 |
| 275 // Check for prohibited data types. | 276 // Check for prohibited data types. |
| 276 if (!IsRemovalPermitted(removal_mask_, GetProfile()->GetPrefs())) { | 277 if (!IsRemovalPermitted(removal_mask_, GetProfile()->GetPrefs())) { |
| 277 error_ = extension_browsing_data_api_constants::kDeleteProhibitedError; | 278 error_ = extension_browsing_data_api_constants::kDeleteProhibitedError; |
| 278 return false; | 279 return false; |
| 279 } | 280 } |
| 280 | 281 |
| 281 if (removal_mask_ & BrowsingDataRemover::REMOVE_PLUGIN_DATA) { | 282 if (removal_mask_ & |
| 283 ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA) { |
| 282 // If we're being asked to remove plugin data, check whether it's actually | 284 // If we're being asked to remove plugin data, check whether it's actually |
| 283 // supported. | 285 // supported. |
| 284 BrowserThread::PostTask( | 286 BrowserThread::PostTask( |
| 285 BrowserThread::FILE, | 287 BrowserThread::FILE, |
| 286 FROM_HERE, | 288 FROM_HERE, |
| 287 base::Bind( | 289 base::Bind( |
| 288 &BrowsingDataRemoverFunction::CheckRemovingPluginDataSupported, | 290 &BrowsingDataRemoverFunction::CheckRemovingPluginDataSupported, |
| 289 this, | 291 this, |
| 290 PluginPrefs::GetForProfile(GetProfile()))); | 292 PluginPrefs::GetForProfile(GetProfile()))); |
| 291 } else { | 293 } else { |
| 292 StartRemoving(); | 294 StartRemoving(); |
| 293 } | 295 } |
| 294 | 296 |
| 295 // Will finish asynchronously. | 297 // Will finish asynchronously. |
| 296 return true; | 298 return true; |
| 297 } | 299 } |
| 298 | 300 |
| 299 BrowsingDataRemoverFunction::~BrowsingDataRemoverFunction() {} | 301 BrowsingDataRemoverFunction::~BrowsingDataRemoverFunction() {} |
| 300 | 302 |
| 301 void BrowsingDataRemoverFunction::CheckRemovingPluginDataSupported( | 303 void BrowsingDataRemoverFunction::CheckRemovingPluginDataSupported( |
| 302 scoped_refptr<PluginPrefs> plugin_prefs) { | 304 scoped_refptr<PluginPrefs> plugin_prefs) { |
| 303 if (!PluginDataRemoverHelper::IsSupported(plugin_prefs.get())) | 305 if (!PluginDataRemoverHelper::IsSupported(plugin_prefs.get())) |
| 304 removal_mask_ &= ~BrowsingDataRemover::REMOVE_PLUGIN_DATA; | 306 removal_mask_ &= ~ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA; |
| 305 | 307 |
| 306 BrowserThread::PostTask( | 308 BrowserThread::PostTask( |
| 307 BrowserThread::UI, FROM_HERE, | 309 BrowserThread::UI, FROM_HERE, |
| 308 base::Bind(&BrowsingDataRemoverFunction::StartRemoving, this)); | 310 base::Bind(&BrowsingDataRemoverFunction::StartRemoving, this)); |
| 309 } | 311 } |
| 310 | 312 |
| 311 void BrowsingDataRemoverFunction::StartRemoving() { | 313 void BrowsingDataRemoverFunction::StartRemoving() { |
| 312 BrowsingDataRemover* remover = | 314 BrowsingDataRemover* remover = |
| 313 BrowsingDataRemoverFactory::GetForBrowserContext(GetProfile()); | 315 BrowsingDataRemoverFactory::GetForBrowserContext(GetProfile()); |
| 314 // Add a ref (Balanced in OnBrowsingDataRemoverDone) | 316 // Add a ref (Balanced in OnBrowsingDataRemoverDone) |
| 315 AddRef(); | 317 AddRef(); |
| 316 | 318 |
| 317 // Create a BrowsingDataRemover, set the current object as an observer (so | 319 // Create a BrowsingDataRemover, set the current object as an observer (so |
| 318 // that we're notified after removal) and call remove() with the arguments | 320 // that we're notified after removal) and call remove() with the arguments |
| 319 // we've generated above. We can use a raw pointer here, as the browsing data | 321 // we've generated above. We can use a raw pointer here, as the browsing data |
| 320 // remover is responsible for deleting itself once data removal is complete. | 322 // remover is responsible for deleting itself once data removal is complete. |
| 321 observer_.Add(remover); | 323 observer_.Add(remover); |
| 322 remover->RemoveAndReply( | 324 remover->RemoveAndReply( |
| 323 remove_since_, base::Time::Max(), | 325 remove_since_, base::Time::Max(), |
| 324 removal_mask_, origin_type_mask_, this); | 326 removal_mask_, origin_type_mask_, this); |
| 325 } | 327 } |
| 326 | 328 |
| 327 bool BrowsingDataRemoverFunction::ParseOriginTypeMask( | 329 bool BrowsingDataRemoverFunction::ParseOriginTypeMask( |
| 328 const base::DictionaryValue& options, | 330 const base::DictionaryValue& options, |
| 329 int* origin_type_mask) { | 331 int* origin_type_mask) { |
| 330 // Parse the |options| dictionary to generate the origin set mask. Default to | 332 // Parse the |options| dictionary to generate the origin set mask. Default to |
| 331 // UNPROTECTED_WEB if the developer doesn't specify anything. | 333 // UNPROTECTED_WEB if the developer doesn't specify anything. |
| 332 *origin_type_mask = BrowsingDataHelper::UNPROTECTED_WEB; | 334 *origin_type_mask = BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB; |
| 333 | 335 |
| 334 const base::DictionaryValue* d = NULL; | 336 const base::DictionaryValue* d = NULL; |
| 335 if (options.HasKey(extension_browsing_data_api_constants::kOriginTypesKey)) { | 337 if (options.HasKey(extension_browsing_data_api_constants::kOriginTypesKey)) { |
| 336 if (!options.GetDictionary( | 338 if (!options.GetDictionary( |
| 337 extension_browsing_data_api_constants::kOriginTypesKey, &d)) { | 339 extension_browsing_data_api_constants::kOriginTypesKey, &d)) { |
| 338 return false; | 340 return false; |
| 339 } | 341 } |
| 340 bool value; | 342 bool value; |
| 341 | 343 |
| 342 // The developer specified something! Reset to 0 and parse the dictionary. | 344 // The developer specified something! Reset to 0 and parse the dictionary. |
| 343 *origin_type_mask = 0; | 345 *origin_type_mask = 0; |
| 344 | 346 |
| 345 // Unprotected web. | 347 // Unprotected web. |
| 346 if (d->HasKey(extension_browsing_data_api_constants::kUnprotectedWebKey)) { | 348 if (d->HasKey(extension_browsing_data_api_constants::kUnprotectedWebKey)) { |
| 347 if (!d->GetBoolean( | 349 if (!d->GetBoolean( |
| 348 extension_browsing_data_api_constants::kUnprotectedWebKey, | 350 extension_browsing_data_api_constants::kUnprotectedWebKey, |
| 349 &value)) { | 351 &value)) { |
| 350 return false; | 352 return false; |
| 351 } | 353 } |
| 352 *origin_type_mask |= value ? BrowsingDataHelper::UNPROTECTED_WEB : 0; | 354 *origin_type_mask |= |
| 355 value ? BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB : 0; |
| 353 } | 356 } |
| 354 | 357 |
| 355 // Protected web. | 358 // Protected web. |
| 356 if (d->HasKey(extension_browsing_data_api_constants::kProtectedWebKey)) { | 359 if (d->HasKey(extension_browsing_data_api_constants::kProtectedWebKey)) { |
| 357 if (!d->GetBoolean( | 360 if (!d->GetBoolean( |
| 358 extension_browsing_data_api_constants::kProtectedWebKey, | 361 extension_browsing_data_api_constants::kProtectedWebKey, |
| 359 &value)) { | 362 &value)) { |
| 360 return false; | 363 return false; |
| 361 } | 364 } |
| 362 *origin_type_mask |= value ? BrowsingDataHelper::PROTECTED_WEB : 0; | 365 *origin_type_mask |= |
| 366 value ? BrowsingDataRemover::ORIGIN_TYPE_PROTECTED_WEB : 0; |
| 363 } | 367 } |
| 364 | 368 |
| 365 // Extensions. | 369 // Extensions. |
| 366 if (d->HasKey(extension_browsing_data_api_constants::kExtensionsKey)) { | 370 if (d->HasKey(extension_browsing_data_api_constants::kExtensionsKey)) { |
| 367 if (!d->GetBoolean(extension_browsing_data_api_constants::kExtensionsKey, | 371 if (!d->GetBoolean(extension_browsing_data_api_constants::kExtensionsKey, |
| 368 &value)) { | 372 &value)) { |
| 369 return false; | 373 return false; |
| 370 } | 374 } |
| 371 *origin_type_mask |= value ? BrowsingDataHelper::EXTENSION : 0; | 375 *origin_type_mask |= |
| 376 value ? ChromeBrowsingDataRemoverDelegate::ORIGIN_TYPE_EXTENSION : 0; |
| 372 } | 377 } |
| 373 } | 378 } |
| 374 | 379 |
| 375 return true; | 380 return true; |
| 376 } | 381 } |
| 377 | 382 |
| 378 // Parses the |dataToRemove| argument to generate the removal mask. | 383 // Parses the |dataToRemove| argument to generate the removal mask. |
| 379 // Returns false if parse was not successful, i.e. if 'dataToRemove' is not | 384 // Returns false if parse was not successful, i.e. if 'dataToRemove' is not |
| 380 // present or any data-type keys don't have supported (boolean) values. | 385 // present or any data-type keys don't have supported (boolean) values. |
| 381 bool BrowsingDataRemoveFunction::GetRemovalMask(int* removal_mask) { | 386 bool BrowsingDataRemoveFunction::GetRemovalMask(int* removal_mask) { |
| 382 base::DictionaryValue* data_to_remove; | 387 base::DictionaryValue* data_to_remove; |
| 383 if (!args_->GetDictionary(1, &data_to_remove)) | 388 if (!args_->GetDictionary(1, &data_to_remove)) |
| 384 return false; | 389 return false; |
| 385 | 390 |
| 386 *removal_mask = 0; | 391 *removal_mask = 0; |
| 387 for (base::DictionaryValue::Iterator i(*data_to_remove); | 392 for (base::DictionaryValue::Iterator i(*data_to_remove); |
| 388 !i.IsAtEnd(); | 393 !i.IsAtEnd(); |
| 389 i.Advance()) { | 394 i.Advance()) { |
| 390 bool selected = false; | 395 bool selected = false; |
| 391 if (!i.value().GetAsBoolean(&selected)) | 396 if (!i.value().GetAsBoolean(&selected)) |
| 392 return false; | 397 return false; |
| 393 if (selected) | 398 if (selected) |
| 394 *removal_mask |= MaskForKey(i.key().c_str()); | 399 *removal_mask |= MaskForKey(i.key().c_str()); |
| 395 } | 400 } |
| 396 | 401 |
| 397 return true; | 402 return true; |
| 398 } | 403 } |
| 399 | 404 |
| 400 bool BrowsingDataRemoveAppcacheFunction::GetRemovalMask(int* removal_mask) { | 405 bool BrowsingDataRemoveAppcacheFunction::GetRemovalMask(int* removal_mask) { |
| 401 *removal_mask = BrowsingDataRemover::REMOVE_APPCACHE; | 406 *removal_mask = BrowsingDataRemover::DATA_TYPE_APP_CACHE; |
| 402 return true; | 407 return true; |
| 403 } | 408 } |
| 404 | 409 |
| 405 bool BrowsingDataRemoveCacheFunction::GetRemovalMask(int* removal_mask) { | 410 bool BrowsingDataRemoveCacheFunction::GetRemovalMask(int* removal_mask) { |
| 406 *removal_mask = BrowsingDataRemover::REMOVE_CACHE; | 411 *removal_mask = BrowsingDataRemover::DATA_TYPE_CACHE; |
| 407 return true; | 412 return true; |
| 408 } | 413 } |
| 409 | 414 |
| 410 bool BrowsingDataRemoveCookiesFunction::GetRemovalMask(int* removal_mask) { | 415 bool BrowsingDataRemoveCookiesFunction::GetRemovalMask(int* removal_mask) { |
| 411 *removal_mask = BrowsingDataRemover::REMOVE_COOKIES | | 416 *removal_mask = BrowsingDataRemover::DATA_TYPE_COOKIES | |
| 412 BrowsingDataRemover::REMOVE_CHANNEL_IDS; | 417 BrowsingDataRemover::DATA_TYPE_CHANNEL_IDS; |
| 413 return true; | 418 return true; |
| 414 } | 419 } |
| 415 | 420 |
| 416 bool BrowsingDataRemoveDownloadsFunction::GetRemovalMask(int* removal_mask) { | 421 bool BrowsingDataRemoveDownloadsFunction::GetRemovalMask(int* removal_mask) { |
| 417 *removal_mask = BrowsingDataRemover::REMOVE_DOWNLOADS; | 422 *removal_mask = BrowsingDataRemover::DATA_TYPE_DOWNLOADS; |
| 418 return true; | 423 return true; |
| 419 } | 424 } |
| 420 | 425 |
| 421 bool BrowsingDataRemoveFileSystemsFunction::GetRemovalMask(int* removal_mask) { | 426 bool BrowsingDataRemoveFileSystemsFunction::GetRemovalMask(int* removal_mask) { |
| 422 *removal_mask = BrowsingDataRemover::REMOVE_FILE_SYSTEMS; | 427 *removal_mask = BrowsingDataRemover::DATA_TYPE_FILE_SYSTEMS; |
| 423 return true; | 428 return true; |
| 424 } | 429 } |
| 425 | 430 |
| 426 bool BrowsingDataRemoveFormDataFunction::GetRemovalMask(int* removal_mask) { | 431 bool BrowsingDataRemoveFormDataFunction::GetRemovalMask(int* removal_mask) { |
| 427 *removal_mask = BrowsingDataRemover::REMOVE_FORM_DATA; | 432 *removal_mask = ChromeBrowsingDataRemoverDelegate::DATA_TYPE_FORM_DATA; |
| 428 return true; | 433 return true; |
| 429 } | 434 } |
| 430 | 435 |
| 431 bool BrowsingDataRemoveHistoryFunction::GetRemovalMask(int* removal_mask) { | 436 bool BrowsingDataRemoveHistoryFunction::GetRemovalMask(int* removal_mask) { |
| 432 *removal_mask = BrowsingDataRemover::REMOVE_HISTORY; | 437 *removal_mask = ChromeBrowsingDataRemoverDelegate::DATA_TYPE_HISTORY; |
| 433 return true; | 438 return true; |
| 434 } | 439 } |
| 435 | 440 |
| 436 bool BrowsingDataRemoveIndexedDBFunction::GetRemovalMask(int* removal_mask) { | 441 bool BrowsingDataRemoveIndexedDBFunction::GetRemovalMask(int* removal_mask) { |
| 437 *removal_mask = BrowsingDataRemover::REMOVE_INDEXEDDB; | 442 *removal_mask = BrowsingDataRemover::DATA_TYPE_INDEXED_DB; |
| 438 return true; | 443 return true; |
| 439 } | 444 } |
| 440 | 445 |
| 441 bool BrowsingDataRemoveLocalStorageFunction::GetRemovalMask(int* removal_mask) { | 446 bool BrowsingDataRemoveLocalStorageFunction::GetRemovalMask(int* removal_mask) { |
| 442 *removal_mask = BrowsingDataRemover::REMOVE_LOCAL_STORAGE; | 447 *removal_mask = BrowsingDataRemover::DATA_TYPE_LOCAL_STORAGE; |
| 443 return true; | 448 return true; |
| 444 } | 449 } |
| 445 | 450 |
| 446 bool BrowsingDataRemovePluginDataFunction::GetRemovalMask(int* removal_mask) { | 451 bool BrowsingDataRemovePluginDataFunction::GetRemovalMask(int* removal_mask) { |
| 447 *removal_mask = BrowsingDataRemover::REMOVE_PLUGIN_DATA; | 452 *removal_mask = ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PLUGIN_DATA; |
| 448 return true; | 453 return true; |
| 449 } | 454 } |
| 450 | 455 |
| 451 bool BrowsingDataRemovePasswordsFunction::GetRemovalMask(int* removal_mask) { | 456 bool BrowsingDataRemovePasswordsFunction::GetRemovalMask(int* removal_mask) { |
| 452 *removal_mask = BrowsingDataRemover::REMOVE_PASSWORDS; | 457 *removal_mask = ChromeBrowsingDataRemoverDelegate::DATA_TYPE_PASSWORDS; |
| 453 return true; | 458 return true; |
| 454 } | 459 } |
| 455 | 460 |
| 456 bool BrowsingDataRemoveServiceWorkersFunction::GetRemovalMask( | 461 bool BrowsingDataRemoveServiceWorkersFunction::GetRemovalMask( |
| 457 int* removal_mask) { | 462 int* removal_mask) { |
| 458 *removal_mask = BrowsingDataRemover::REMOVE_SERVICE_WORKERS; | 463 *removal_mask = BrowsingDataRemover::DATA_TYPE_SERVICE_WORKERS; |
| 459 return true; | 464 return true; |
| 460 } | 465 } |
| 461 | 466 |
| 462 bool BrowsingDataRemoveCacheStorageFunction::GetRemovalMask(int* removal_mask) { | 467 bool BrowsingDataRemoveCacheStorageFunction::GetRemovalMask(int* removal_mask) { |
| 463 *removal_mask = BrowsingDataRemover::REMOVE_CACHE_STORAGE; | 468 *removal_mask = BrowsingDataRemover::DATA_TYPE_CACHE_STORAGE; |
| 464 return true; | 469 return true; |
| 465 } | 470 } |
| 466 | 471 |
| 467 bool BrowsingDataRemoveWebSQLFunction::GetRemovalMask(int* removal_mask) { | 472 bool BrowsingDataRemoveWebSQLFunction::GetRemovalMask(int* removal_mask) { |
| 468 *removal_mask = BrowsingDataRemover::REMOVE_WEBSQL; | 473 *removal_mask = BrowsingDataRemover::DATA_TYPE_WEB_SQL; |
| 469 return true; | 474 return true; |
| 470 } | 475 } |
| OLD | NEW |