| 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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 waiting_for_clear_history_ = true; | 515 waiting_for_clear_history_ = true; |
| 516 history_service->ExpireLocalAndRemoteHistoryBetween( | 516 history_service->ExpireLocalAndRemoteHistoryBetween( |
| 517 WebHistoryServiceFactory::GetForProfile(profile_), std::set<GURL>(), | 517 WebHistoryServiceFactory::GetForProfile(profile_), std::set<GURL>(), |
| 518 delete_begin_, delete_end_, | 518 delete_begin_, delete_end_, |
| 519 base::Bind(&BrowsingDataRemover::OnHistoryDeletionDone, | 519 base::Bind(&BrowsingDataRemover::OnHistoryDeletionDone, |
| 520 weak_ptr_factory_.GetWeakPtr()), | 520 weak_ptr_factory_.GetWeakPtr()), |
| 521 &history_task_tracker_); | 521 &history_task_tracker_); |
| 522 } | 522 } |
| 523 | 523 |
| 524 ntp_snippets::ContentSuggestionsService* content_suggestions_service = | 524 ntp_snippets::ContentSuggestionsService* content_suggestions_service = |
| 525 ContentSuggestionsServiceFactory::GetForProfile(profile_); | 525 ContentSuggestionsServiceFactory::GetForProfileIfExists(profile_); |
| 526 if (content_suggestions_service) { | 526 if (content_suggestions_service) { |
| 527 content_suggestions_service->ClearHistory(delete_begin_, delete_end_, | 527 content_suggestions_service->ClearHistory(delete_begin_, delete_end_, |
| 528 filter); | 528 filter); |
| 529 } | 529 } |
| 530 | 530 |
| 531 #if defined(ENABLE_EXTENSIONS) | 531 #if defined(ENABLE_EXTENSIONS) |
| 532 // The extension activity log contains details of which websites extensions | 532 // The extension activity log contains details of which websites extensions |
| 533 // were active on. It therefore indirectly stores details of websites a | 533 // were active on. It therefore indirectly stores details of websites a |
| 534 // user has visited so best clean from here as well. | 534 // user has visited so best clean from here as well. |
| 535 // TODO(msramek): Support all backends with filter (crbug.com/589586). | 535 // TODO(msramek): Support all backends with filter (crbug.com/589586). |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 | 1009 |
| 1010 // When clearing cache, wipe accumulated network related data | 1010 // When clearing cache, wipe accumulated network related data |
| 1011 // (TransportSecurityState and HttpServerPropertiesManager data). | 1011 // (TransportSecurityState and HttpServerPropertiesManager data). |
| 1012 waiting_for_clear_networking_history_ = true; | 1012 waiting_for_clear_networking_history_ = true; |
| 1013 profile_->ClearNetworkingHistorySince( | 1013 profile_->ClearNetworkingHistorySince( |
| 1014 delete_begin_, | 1014 delete_begin_, |
| 1015 base::Bind(&BrowsingDataRemover::OnClearedNetworkingHistory, | 1015 base::Bind(&BrowsingDataRemover::OnClearedNetworkingHistory, |
| 1016 weak_ptr_factory_.GetWeakPtr())); | 1016 weak_ptr_factory_.GetWeakPtr())); |
| 1017 | 1017 |
| 1018 ntp_snippets::ContentSuggestionsService* content_suggestions_service = | 1018 ntp_snippets::ContentSuggestionsService* content_suggestions_service = |
| 1019 ContentSuggestionsServiceFactory::GetForProfile(profile_); | 1019 ContentSuggestionsServiceFactory::GetForProfileIfExists(profile_); |
| 1020 if (content_suggestions_service) | 1020 if (content_suggestions_service) |
| 1021 content_suggestions_service->ClearAllCachedSuggestions(); | 1021 content_suggestions_service->ClearAllCachedSuggestions(); |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 if (remove_mask & REMOVE_COOKIES || remove_mask & REMOVE_PASSWORDS) { | 1024 if (remove_mask & REMOVE_COOKIES || remove_mask & REMOVE_PASSWORDS) { |
| 1025 scoped_refptr<net::URLRequestContextGetter> request_context = | 1025 scoped_refptr<net::URLRequestContextGetter> request_context = |
| 1026 profile_->GetRequestContext(); | 1026 profile_->GetRequestContext(); |
| 1027 waiting_for_clear_http_auth_cache_ = true; | 1027 waiting_for_clear_http_auth_cache_ = true; |
| 1028 BrowserThread::PostTaskAndReply( | 1028 BrowserThread::PostTaskAndReply( |
| 1029 BrowserThread::IO, FROM_HERE, | 1029 BrowserThread::IO, FROM_HERE, |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1535 waiting_for_clear_offline_page_data_ = false; | 1535 waiting_for_clear_offline_page_data_ = false; |
| 1536 NotifyIfDone(); | 1536 NotifyIfDone(); |
| 1537 } | 1537 } |
| 1538 #endif | 1538 #endif |
| 1539 | 1539 |
| 1540 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { | 1540 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { |
| 1541 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1541 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1542 waiting_for_clear_domain_reliability_monitor_ = false; | 1542 waiting_for_clear_domain_reliability_monitor_ = false; |
| 1543 NotifyIfDone(); | 1543 NotifyIfDone(); |
| 1544 } | 1544 } |
| OLD | NEW |