| 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 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 5 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 if (!precache_manager) { | 553 if (!precache_manager) { |
| 554 waiting_for_clear_precache_history_ = true; | 554 waiting_for_clear_precache_history_ = true; |
| 555 precache_manager->ClearHistory(); | 555 precache_manager->ClearHistory(); |
| 556 // The above calls are done on the UI thread but do their work on the DB | 556 // The above calls are done on the UI thread but do their work on the DB |
| 557 // thread. So wait for it. | 557 // thread. So wait for it. |
| 558 BrowserThread::PostTaskAndReply( | 558 BrowserThread::PostTaskAndReply( |
| 559 BrowserThread::DB, FROM_HERE, base::Bind(&base::DoNothing), | 559 BrowserThread::DB, FROM_HERE, base::Bind(&base::DoNothing), |
| 560 base::Bind(&BrowsingDataRemover::OnClearedPrecacheHistory, | 560 base::Bind(&BrowsingDataRemover::OnClearedPrecacheHistory, |
| 561 weak_ptr_factory_.GetWeakPtr())); | 561 weak_ptr_factory_.GetWeakPtr())); |
| 562 } | 562 } |
| 563 |
| 564 // Clear the history information (last launch time and origin URL) of any |
| 565 // registered webapps. |
| 566 waiting_for_clear_webapp_history_ = true; |
| 567 webapp_registry_->ClearWebappHistory( |
| 568 base::Bind(&BrowsingDataRemover::OnClearedWebappHistory, |
| 569 weak_ptr_factory_.GetWeakPtr())); |
| 563 #endif | 570 #endif |
| 564 | 571 |
| 565 data_reduction_proxy::DataReductionProxySettings* | 572 data_reduction_proxy::DataReductionProxySettings* |
| 566 data_reduction_proxy_settings = | 573 data_reduction_proxy_settings = |
| 567 DataReductionProxyChromeSettingsFactory::GetForBrowserContext( | 574 DataReductionProxyChromeSettingsFactory::GetForBrowserContext( |
| 568 profile_); | 575 profile_); |
| 569 // |data_reduction_proxy_settings| is null if |profile_| is off the record. | 576 // |data_reduction_proxy_settings| is null if |profile_| is off the record. |
| 570 if (data_reduction_proxy_settings) { | 577 if (data_reduction_proxy_settings) { |
| 571 data_reduction_proxy::DataReductionProxyService* | 578 data_reduction_proxy::DataReductionProxyService* |
| 572 data_reduction_proxy_service = | 579 data_reduction_proxy_service = |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 !waiting_for_clear_hostname_resolution_cache_ && | 1019 !waiting_for_clear_hostname_resolution_cache_ && |
| 1013 !waiting_for_clear_keyword_data_ && !waiting_for_clear_nacl_cache_ && | 1020 !waiting_for_clear_keyword_data_ && !waiting_for_clear_nacl_cache_ && |
| 1014 !waiting_for_clear_network_predictor_ && | 1021 !waiting_for_clear_network_predictor_ && |
| 1015 !waiting_for_clear_networking_history_ && | 1022 !waiting_for_clear_networking_history_ && |
| 1016 !waiting_for_clear_passwords_ && !waiting_for_clear_passwords_stats_ && | 1023 !waiting_for_clear_passwords_ && !waiting_for_clear_passwords_stats_ && |
| 1017 !waiting_for_clear_platform_keys_ && !waiting_for_clear_plugin_data_ && | 1024 !waiting_for_clear_platform_keys_ && !waiting_for_clear_plugin_data_ && |
| 1018 !waiting_for_clear_pnacl_cache_ && | 1025 !waiting_for_clear_pnacl_cache_ && |
| 1019 #if BUILDFLAG(ANDROID_JAVA_UI) | 1026 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 1020 !waiting_for_clear_precache_history_ && | 1027 !waiting_for_clear_precache_history_ && |
| 1021 !waiting_for_clear_webapp_data_ && | 1028 !waiting_for_clear_webapp_data_ && |
| 1029 !waiting_for_clear_webapp_history_ && |
| 1022 !waiting_for_clear_offline_page_data_ && | 1030 !waiting_for_clear_offline_page_data_ && |
| 1023 #endif | 1031 #endif |
| 1024 #if defined(ENABLE_WEBRTC) | 1032 #if defined(ENABLE_WEBRTC) |
| 1025 !waiting_for_clear_webrtc_logs_ && | 1033 !waiting_for_clear_webrtc_logs_ && |
| 1026 #endif | 1034 #endif |
| 1027 !waiting_for_clear_storage_partition_data_ && | 1035 !waiting_for_clear_storage_partition_data_ && |
| 1028 !waiting_for_clear_auto_sign_in_; | 1036 !waiting_for_clear_auto_sign_in_; |
| 1029 } | 1037 } |
| 1030 | 1038 |
| 1031 void BrowsingDataRemover::OnKeywordsLoaded() { | 1039 void BrowsingDataRemover::OnKeywordsLoaded() { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 waiting_for_clear_precache_history_ = false; | 1219 waiting_for_clear_precache_history_ = false; |
| 1212 NotifyIfDone(); | 1220 NotifyIfDone(); |
| 1213 } | 1221 } |
| 1214 | 1222 |
| 1215 void BrowsingDataRemover::OnClearedWebappData() { | 1223 void BrowsingDataRemover::OnClearedWebappData() { |
| 1216 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1224 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1217 waiting_for_clear_webapp_data_ = false; | 1225 waiting_for_clear_webapp_data_ = false; |
| 1218 NotifyIfDone(); | 1226 NotifyIfDone(); |
| 1219 } | 1227 } |
| 1220 | 1228 |
| 1229 void BrowsingDataRemover::OnClearedWebappHistory() { |
| 1230 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1231 waiting_for_clear_webapp_history_ = false; |
| 1232 NotifyIfDone(); |
| 1233 } |
| 1234 |
| 1221 void BrowsingDataRemover::OnClearedOfflinePageData() { | 1235 void BrowsingDataRemover::OnClearedOfflinePageData() { |
| 1222 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1236 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1223 waiting_for_clear_offline_page_data_ = false; | 1237 waiting_for_clear_offline_page_data_ = false; |
| 1224 NotifyIfDone(); | 1238 NotifyIfDone(); |
| 1225 } | 1239 } |
| 1226 #endif | 1240 #endif |
| 1227 | 1241 |
| 1228 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { | 1242 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { |
| 1229 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1243 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1230 waiting_for_clear_domain_reliability_monitor_ = false; | 1244 waiting_for_clear_domain_reliability_monitor_ = false; |
| 1231 NotifyIfDone(); | 1245 NotifyIfDone(); |
| 1232 } | 1246 } |
| 1233 | 1247 |
| 1234 // static | 1248 // static |
| 1235 BrowsingDataRemover::CallbackSubscription | 1249 BrowsingDataRemover::CallbackSubscription |
| 1236 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( | 1250 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( |
| 1237 const BrowsingDataRemover::Callback& callback) { | 1251 const BrowsingDataRemover::Callback& callback) { |
| 1238 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); | 1252 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); |
| 1239 } | 1253 } |
| OLD | NEW |