Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover.cc

Issue 1970423002: [Offline Pages] Clear offline pages when user clears cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698