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

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

Issue 901803005: Remove dependency of HistoryService on WebHistoryServiceFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DEPS
Patch Set: Rebase Created 5 years, 10 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 | « no previous file | chrome/browser/history/history_service.h » ('j') | 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
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/prefs/pref_service.h" 15 #include "base/prefs/pref_service.h"
16 #include "chrome/browser/autofill/personal_data_manager_factory.h" 16 #include "chrome/browser/autofill/personal_data_manager_factory.h"
17 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/browsing_data/browsing_data_helper.h" 18 #include "chrome/browser/browsing_data/browsing_data_helper.h"
19 #include "chrome/browser/chrome_notification_types.h" 19 #include "chrome/browser/chrome_notification_types.h"
20 #include "chrome/browser/domain_reliability/service_factory.h" 20 #include "chrome/browser/domain_reliability/service_factory.h"
21 #include "chrome/browser/download/download_prefs.h" 21 #include "chrome/browser/download/download_prefs.h"
22 #include "chrome/browser/download/download_service_factory.h" 22 #include "chrome/browser/download/download_service_factory.h"
23 #include "chrome/browser/history/history_service.h" 23 #include "chrome/browser/history/history_service.h"
24 #include "chrome/browser/history/history_service_factory.h" 24 #include "chrome/browser/history/history_service_factory.h"
25 #include "chrome/browser/history/web_history_service_factory.h"
25 #include "chrome/browser/io_thread.h" 26 #include "chrome/browser/io_thread.h"
26 #include "chrome/browser/media/media_device_id_salt.h" 27 #include "chrome/browser/media/media_device_id_salt.h"
27 #include "chrome/browser/net/predictor.h" 28 #include "chrome/browser/net/predictor.h"
28 #include "chrome/browser/password_manager/password_store_factory.h" 29 #include "chrome/browser/password_manager/password_store_factory.h"
29 #include "chrome/browser/predictors/logged_in_predictor_table.h" 30 #include "chrome/browser/predictors/logged_in_predictor_table.h"
30 #include "chrome/browser/predictors/predictor_database.h" 31 #include "chrome/browser/predictors/predictor_database.h"
31 #include "chrome/browser/predictors/predictor_database_factory.h" 32 #include "chrome/browser/predictors/predictor_database_factory.h"
32 #include "chrome/browser/prerender/prerender_manager.h" 33 #include "chrome/browser/prerender/prerender_manager.h"
33 #include "chrome/browser/prerender/prerender_manager_factory.h" 34 #include "chrome/browser/prerender/prerender_manager_factory.h"
34 #include "chrome/browser/profiles/profile.h" 35 #include "chrome/browser/profiles/profile.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 HistoryService* history_service = HistoryServiceFactory::GetForProfile( 302 HistoryService* history_service = HistoryServiceFactory::GetForProfile(
302 profile_, ServiceAccessType::EXPLICIT_ACCESS); 303 profile_, ServiceAccessType::EXPLICIT_ACCESS);
303 if (history_service) { 304 if (history_service) {
304 std::set<GURL> restrict_urls; 305 std::set<GURL> restrict_urls;
305 if (!remove_origin_.is_empty()) 306 if (!remove_origin_.is_empty())
306 restrict_urls.insert(remove_origin_); 307 restrict_urls.insert(remove_origin_);
307 content::RecordAction(UserMetricsAction("ClearBrowsingData_History")); 308 content::RecordAction(UserMetricsAction("ClearBrowsingData_History"));
308 waiting_for_clear_history_ = true; 309 waiting_for_clear_history_ = true;
309 310
310 history_service->ExpireLocalAndRemoteHistoryBetween( 311 history_service->ExpireLocalAndRemoteHistoryBetween(
312 WebHistoryServiceFactory::GetForProfile(profile_),
311 restrict_urls, delete_begin_, delete_end_, 313 restrict_urls, delete_begin_, delete_end_,
312 base::Bind(&BrowsingDataRemover::OnHistoryDeletionDone, 314 base::Bind(&BrowsingDataRemover::OnHistoryDeletionDone,
313 base::Unretained(this)), 315 base::Unretained(this)),
314 &history_task_tracker_); 316 &history_task_tracker_);
315 317
316 #if defined(ENABLE_EXTENSIONS) 318 #if defined(ENABLE_EXTENSIONS)
317 // The extension activity contains details of which websites extensions 319 // The extension activity contains details of which websites extensions
318 // were active on. It therefore indirectly stores details of websites a 320 // were active on. It therefore indirectly stores details of websites a
319 // user has visited so best clean from here as well. 321 // user has visited so best clean from here as well.
320 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs(restrict_urls); 322 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs(restrict_urls);
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 waiting_for_clear_domain_reliability_monitor_ = false; 1220 waiting_for_clear_domain_reliability_monitor_ = false;
1219 NotifyAndDeleteIfDone(); 1221 NotifyAndDeleteIfDone();
1220 } 1222 }
1221 1223
1222 // static 1224 // static
1223 BrowsingDataRemover::CallbackSubscription 1225 BrowsingDataRemover::CallbackSubscription
1224 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( 1226 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback(
1225 const BrowsingDataRemover::Callback& callback) { 1227 const BrowsingDataRemover::Callback& callback) {
1226 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); 1228 return GetOnBrowsingDataRemovedCallbacks()->Add(callback);
1227 } 1229 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/history_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698