| 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 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 #if BUILDFLAG(ANDROID_JAVA_UI) | 997 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 998 if (remove_mask & REMOVE_WEBAPP_DATA) { | 998 if (remove_mask & REMOVE_WEBAPP_DATA) { |
| 999 // Clear all data associated with registered webapps. The webapp_registry | 999 // Clear all data associated with registered webapps. The webapp_registry |
| 1000 // makes a JNI call into a Java-side AsyncTask, so don't wait for the reply. | 1000 // makes a JNI call into a Java-side AsyncTask, so don't wait for the reply. |
| 1001 waiting_for_clear_webapp_data_ = true; | 1001 waiting_for_clear_webapp_data_ = true; |
| 1002 webapp_registry_->UnregisterWebapps( | 1002 webapp_registry_->UnregisterWebapps( |
| 1003 base::Bind(&BrowsingDataRemover::OnClearedWebappData, | 1003 base::Bind(&BrowsingDataRemover::OnClearedWebappData, |
| 1004 weak_ptr_factory_.GetWeakPtr())); | 1004 weak_ptr_factory_.GetWeakPtr())); |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 if ((remove_mask & REMOVE_OFFLINE_PAGE_DATA) && | 1007 // For now we're considering offline pages as cache, so if we're removing |
| 1008 offline_pages::IsOfflinePagesEnabled()) { | 1008 // cache we should remove offline pages as well. |
| 1009 if ((remove_mask & REMOVE_CACHE) && offline_pages::IsOfflinePagesEnabled()) { |
| 1009 waiting_for_clear_offline_page_data_ = true; | 1010 waiting_for_clear_offline_page_data_ = true; |
| 1010 offline_pages::OfflinePageModelFactory::GetForBrowserContext(profile_) | 1011 offline_pages::OfflinePageModelFactory::GetForBrowserContext(profile_) |
| 1011 ->DeletePagesByURLPredicate( | 1012 ->DeletePagesByURLPredicate( |
| 1012 filter, | 1013 filter, |
| 1013 base::Bind(&BrowsingDataRemover::OnClearedOfflinePageData, | 1014 base::Bind(&BrowsingDataRemover::OnClearedOfflinePageData, |
| 1014 weak_ptr_factory_.GetWeakPtr())); | 1015 weak_ptr_factory_.GetWeakPtr())); |
| 1015 } | 1016 } |
| 1016 #endif | 1017 #endif |
| 1017 | 1018 |
| 1018 // Record the combined deletion of cookies and cache. | 1019 // Record the combined deletion of cookies and cache. |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1330 waiting_for_clear_domain_reliability_monitor_ = false; | 1331 waiting_for_clear_domain_reliability_monitor_ = false; |
| 1331 NotifyIfDone(); | 1332 NotifyIfDone(); |
| 1332 } | 1333 } |
| 1333 | 1334 |
| 1334 // static | 1335 // static |
| 1335 BrowsingDataRemover::CallbackSubscription | 1336 BrowsingDataRemover::CallbackSubscription |
| 1336 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( | 1337 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( |
| 1337 const BrowsingDataRemover::Callback& callback) { | 1338 const BrowsingDataRemover::Callback& callback) { |
| 1338 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); | 1339 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); |
| 1339 } | 1340 } |
| OLD | NEW |