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 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 REMOVE_CONTENT_LICENSES = 1 << 13, | 77 REMOVE_CONTENT_LICENSES = 1 << 13, |
78 REMOVE_SERVICE_WORKERS = 1 << 14, | 78 REMOVE_SERVICE_WORKERS = 1 << 14, |
79 REMOVE_SITE_USAGE_DATA = 1 << 15, | 79 REMOVE_SITE_USAGE_DATA = 1 << 15, |
80 // REMOVE_NOCHECKS intentionally does not check if the Profile's prohibited | 80 // REMOVE_NOCHECKS intentionally does not check if the Profile's prohibited |
81 // from deleting history or downloads. | 81 // from deleting history or downloads. |
82 REMOVE_NOCHECKS = 1 << 16, | 82 REMOVE_NOCHECKS = 1 << 16, |
83 REMOVE_WEBRTC_IDENTITY = 1 << 17, | 83 REMOVE_WEBRTC_IDENTITY = 1 << 17, |
84 REMOVE_CACHE_STORAGE = 1 << 18, | 84 REMOVE_CACHE_STORAGE = 1 << 18, |
85 #if defined(OS_ANDROID) | 85 #if defined(OS_ANDROID) |
86 REMOVE_WEBAPP_DATA = 1 << 19, | 86 REMOVE_WEBAPP_DATA = 1 << 19, |
| 87 REMOVE_OFFLINE_PAGE_DATA = 1 << 20, |
87 #endif | 88 #endif |
88 // The following flag is used only in tests. In normal usage, hosted app | 89 // The following flag is used only in tests. In normal usage, hosted app |
89 // data is controlled by the REMOVE_COOKIES flag, applied to the | 90 // data is controlled by the REMOVE_COOKIES flag, applied to the |
90 // protected-web origin. | 91 // protected-web origin. |
91 REMOVE_HOSTED_APP_DATA_TESTONLY = 1 << 31, | 92 REMOVE_HOSTED_APP_DATA_TESTONLY = 1 << 31, |
92 | 93 |
93 // "Site data" includes cookies, appcache, file systems, indexedDBs, local | 94 // "Site data" includes cookies, appcache, file systems, indexedDBs, local |
94 // storage, webSQL, service workers, cache storage, plugin data, and web app | 95 // storage, webSQL, service workers, cache storage, plugin data, and web app |
95 // data (on Android). | 96 // data (on Android). |
96 REMOVE_SITE_DATA = REMOVE_APPCACHE | REMOVE_COOKIES | REMOVE_FILE_SYSTEMS | | 97 REMOVE_SITE_DATA = REMOVE_APPCACHE | REMOVE_COOKIES | REMOVE_FILE_SYSTEMS | |
97 REMOVE_INDEXEDDB | | 98 REMOVE_INDEXEDDB | |
98 REMOVE_LOCAL_STORAGE | | 99 REMOVE_LOCAL_STORAGE | |
99 REMOVE_PLUGIN_DATA | | 100 REMOVE_PLUGIN_DATA | |
100 REMOVE_SERVICE_WORKERS | | 101 REMOVE_SERVICE_WORKERS | |
101 REMOVE_CACHE_STORAGE | | 102 REMOVE_CACHE_STORAGE | |
102 REMOVE_WEBSQL | | 103 REMOVE_WEBSQL | |
103 REMOVE_CHANNEL_IDS | | 104 REMOVE_CHANNEL_IDS | |
104 REMOVE_SITE_USAGE_DATA | | 105 REMOVE_SITE_USAGE_DATA | |
105 #if defined(OS_ANDROID) | 106 #if defined(OS_ANDROID) |
106 REMOVE_WEBAPP_DATA | | 107 REMOVE_WEBAPP_DATA | |
| 108 REMOVE_OFFLINE_PAGE_DATA | |
107 #endif | 109 #endif |
108 REMOVE_WEBRTC_IDENTITY, | 110 REMOVE_WEBRTC_IDENTITY, |
109 | 111 |
110 // Includes all the available remove options. Meant to be used by clients | 112 // Includes all the available remove options. Meant to be used by clients |
111 // that wish to wipe as much data as possible from a Profile, to make it | 113 // that wish to wipe as much data as possible from a Profile, to make it |
112 // look like a new Profile. | 114 // look like a new Profile. |
113 REMOVE_ALL = REMOVE_SITE_DATA | REMOVE_CACHE | REMOVE_DOWNLOADS | | 115 REMOVE_ALL = REMOVE_SITE_DATA | REMOVE_CACHE | REMOVE_DOWNLOADS | |
114 REMOVE_FORM_DATA | | 116 REMOVE_FORM_DATA | |
115 REMOVE_HISTORY | | 117 REMOVE_HISTORY | |
116 REMOVE_PASSWORDS | | 118 REMOVE_PASSWORDS | |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 // Callback on UI thread when the WebRTC logs have been deleted. | 391 // Callback on UI thread when the WebRTC logs have been deleted. |
390 void OnClearedWebRtcLogs(); | 392 void OnClearedWebRtcLogs(); |
391 #endif | 393 #endif |
392 | 394 |
393 #if defined(OS_ANDROID) | 395 #if defined(OS_ANDROID) |
394 // Callback on UI thread when the precache history has been cleared. | 396 // Callback on UI thread when the precache history has been cleared. |
395 void OnClearedPrecacheHistory(); | 397 void OnClearedPrecacheHistory(); |
396 | 398 |
397 // Callback on UI thread when the webapp data has been cleared. | 399 // Callback on UI thread when the webapp data has been cleared. |
398 void OnClearedWebappData(); | 400 void OnClearedWebappData(); |
| 401 |
| 402 // Callback on UI thread when the offline page data has been cleared. |
| 403 void OnClearedOfflinePageData(); |
399 #endif | 404 #endif |
400 | 405 |
401 void OnClearedDomainReliabilityMonitor(); | 406 void OnClearedDomainReliabilityMonitor(); |
402 | 407 |
403 // Returns true if we're all done. | 408 // Returns true if we're all done. |
404 bool AllDone(); | 409 bool AllDone(); |
405 | 410 |
406 // Profile we're to remove from. | 411 // Profile we're to remove from. |
407 Profile* profile_; | 412 Profile* profile_; |
408 | 413 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 bool waiting_for_clear_nacl_cache_ = false; | 455 bool waiting_for_clear_nacl_cache_ = false; |
451 bool waiting_for_clear_network_predictor_ = false; | 456 bool waiting_for_clear_network_predictor_ = false; |
452 bool waiting_for_clear_networking_history_ = false; | 457 bool waiting_for_clear_networking_history_ = false; |
453 bool waiting_for_clear_passwords_ = false; | 458 bool waiting_for_clear_passwords_ = false; |
454 bool waiting_for_clear_platform_keys_ = false; | 459 bool waiting_for_clear_platform_keys_ = false; |
455 bool waiting_for_clear_plugin_data_ = false; | 460 bool waiting_for_clear_plugin_data_ = false; |
456 bool waiting_for_clear_pnacl_cache_ = false; | 461 bool waiting_for_clear_pnacl_cache_ = false; |
457 #if defined(OS_ANDROID) | 462 #if defined(OS_ANDROID) |
458 bool waiting_for_clear_precache_history_ = false; | 463 bool waiting_for_clear_precache_history_ = false; |
459 bool waiting_for_clear_webapp_data_ = false; | 464 bool waiting_for_clear_webapp_data_ = false; |
| 465 bool waiting_for_clear_offline_page_data_ = false; |
460 #endif | 466 #endif |
461 bool waiting_for_clear_storage_partition_data_ = false; | 467 bool waiting_for_clear_storage_partition_data_ = false; |
462 #if defined(ENABLE_WEBRTC) | 468 #if defined(ENABLE_WEBRTC) |
463 bool waiting_for_clear_webrtc_logs_ = false; | 469 bool waiting_for_clear_webrtc_logs_ = false; |
464 #endif | 470 #endif |
465 | 471 |
466 // The removal mask for the current removal operation. | 472 // The removal mask for the current removal operation. |
467 int remove_mask_ = 0; | 473 int remove_mask_ = 0; |
468 | 474 |
469 // From which types of origins should we remove data? | 475 // From which types of origins should we remove data? |
470 int origin_type_mask_ = 0; | 476 int origin_type_mask_ = 0; |
471 | 477 |
472 base::ObserverList<Observer> observer_list_; | 478 base::ObserverList<Observer> observer_list_; |
473 | 479 |
474 // Used if we need to clear history. | 480 // Used if we need to clear history. |
475 base::CancelableTaskTracker history_task_tracker_; | 481 base::CancelableTaskTracker history_task_tracker_; |
476 | 482 |
477 scoped_ptr<TemplateURLService::Subscription> template_url_sub_; | 483 scoped_ptr<TemplateURLService::Subscription> template_url_sub_; |
478 | 484 |
479 // We do not own this. | 485 // We do not own this. |
480 content::StoragePartition* storage_partition_for_testing_ = nullptr; | 486 content::StoragePartition* storage_partition_for_testing_ = nullptr; |
481 | 487 |
482 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 488 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
483 }; | 489 }; |
484 | 490 |
485 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 491 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
OLD | NEW |