| 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 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 filter, | 1085 filter, |
| 1086 base::Bind(&BrowsingDataRemover::OnClearedWebappData, | 1086 base::Bind(&BrowsingDataRemover::OnClearedWebappData, |
| 1087 weak_ptr_factory_.GetWeakPtr())); | 1087 weak_ptr_factory_.GetWeakPtr())); |
| 1088 } | 1088 } |
| 1089 | 1089 |
| 1090 // For now we're considering offline pages as cache, so if we're removing | 1090 // For now we're considering offline pages as cache, so if we're removing |
| 1091 // cache we should remove offline pages as well. | 1091 // cache we should remove offline pages as well. |
| 1092 if ((remove_mask & REMOVE_CACHE) && offline_pages::IsOfflinePagesEnabled()) { | 1092 if ((remove_mask & REMOVE_CACHE) && offline_pages::IsOfflinePagesEnabled()) { |
| 1093 waiting_for_clear_offline_page_data_ = true; | 1093 waiting_for_clear_offline_page_data_ = true; |
| 1094 offline_pages::OfflinePageModelFactory::GetForBrowserContext(profile_) | 1094 offline_pages::OfflinePageModelFactory::GetForBrowserContext(profile_) |
| 1095 ->DeletePagesByURLPredicate( | 1095 ->DeleteCachedPagesByURLPredicate( |
| 1096 filter, | 1096 filter, base::Bind(&BrowsingDataRemover::OnClearedOfflinePageData, |
| 1097 base::Bind(&BrowsingDataRemover::OnClearedOfflinePageData, | 1097 weak_ptr_factory_.GetWeakPtr())); |
| 1098 weak_ptr_factory_.GetWeakPtr())); | |
| 1099 } | 1098 } |
| 1100 #endif | 1099 #endif |
| 1101 | 1100 |
| 1102 // Record the combined deletion of cookies and cache. | 1101 // Record the combined deletion of cookies and cache. |
| 1103 CookieOrCacheDeletionChoice choice = NEITHER_COOKIES_NOR_CACHE; | 1102 CookieOrCacheDeletionChoice choice = NEITHER_COOKIES_NOR_CACHE; |
| 1104 if (remove_mask & REMOVE_COOKIES && | 1103 if (remove_mask & REMOVE_COOKIES && |
| 1105 origin_type_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) { | 1104 origin_type_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) { |
| 1106 choice = remove_mask & REMOVE_CACHE ? BOTH_COOKIES_AND_CACHE | 1105 choice = remove_mask & REMOVE_CACHE ? BOTH_COOKIES_AND_CACHE |
| 1107 : ONLY_COOKIES; | 1106 : ONLY_COOKIES; |
| 1108 } else if (remove_mask & REMOVE_CACHE) { | 1107 } else if (remove_mask & REMOVE_CACHE) { |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1481 waiting_for_clear_offline_page_data_ = false; | 1480 waiting_for_clear_offline_page_data_ = false; |
| 1482 NotifyIfDone(); | 1481 NotifyIfDone(); |
| 1483 } | 1482 } |
| 1484 #endif | 1483 #endif |
| 1485 | 1484 |
| 1486 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { | 1485 void BrowsingDataRemover::OnClearedDomainReliabilityMonitor() { |
| 1487 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1486 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1488 waiting_for_clear_domain_reliability_monitor_ = false; | 1487 waiting_for_clear_domain_reliability_monitor_ = false; |
| 1489 NotifyIfDone(); | 1488 NotifyIfDone(); |
| 1490 } | 1489 } |
| OLD | NEW |