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

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

Issue 891763002: Remove dependency of HistoryService on WebHistoryServiceFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@schedule-and-forget
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"
35 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 36 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
36 #include "chrome/browser/search_engines/template_url_service_factory.h" 37 #include "chrome/browser/search_engines/template_url_service_factory.h"
37 #include "chrome/browser/sessions/session_service.h" 38 #include "chrome/browser/sessions/session_service.h"
38 #include "chrome/browser/sessions/session_service_factory.h" 39 #include "chrome/browser/sessions/session_service_factory.h"
39 #include "chrome/browser/sessions/tab_restore_service.h" 40 #include "chrome/browser/sessions/tab_restore_service.h"
40 #include "chrome/browser/sessions/tab_restore_service_factory.h" 41 #include "chrome/browser/sessions/tab_restore_service_factory.h"
41 #include "chrome/browser/webdata/web_data_service_factory.h" 42 #include "chrome/browser/webdata/web_data_service_factory.h"
42 #include "chrome/common/pref_names.h" 43 #include "chrome/common/pref_names.h"
43 #include "chrome/common/url_constants.h" 44 #include "chrome/common/url_constants.h"
44 #include "components/autofill/core/browser/personal_data_manager.h" 45 #include "components/autofill/core/browser/personal_data_manager.h"
45 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" 46 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
46 #include "components/content_settings/core/browser/host_content_settings_map.h" 47 #include "components/content_settings/core/browser/host_content_settings_map.h"
47 #include "components/domain_reliability/service.h" 48 #include "components/domain_reliability/service.h"
49 #include "components/history/core/browser/web_history_service.h"
48 #include "components/nacl/browser/nacl_browser.h" 50 #include "components/nacl/browser/nacl_browser.h"
49 #include "components/nacl/browser/pnacl_host.h" 51 #include "components/nacl/browser/pnacl_host.h"
50 #include "components/password_manager/core/browser/password_store.h" 52 #include "components/password_manager/core/browser/password_store.h"
51 #include "components/power/origin_power_map.h" 53 #include "components/power/origin_power_map.h"
52 #include "components/power/origin_power_map_factory.h" 54 #include "components/power/origin_power_map_factory.h"
53 #include "components/search_engines/template_url_service.h" 55 #include "components/search_engines/template_url_service.h"
54 #include "components/web_cache/browser/web_cache_manager.h" 56 #include "components/web_cache/browser/web_cache_manager.h"
55 #include "content/public/browser/browser_thread.h" 57 #include "content/public/browser/browser_thread.h"
56 #include "content/public/browser/dom_storage_context.h" 58 #include "content/public/browser/dom_storage_context.h"
57 #include "content/public/browser/download_manager.h" 59 #include "content/public/browser/download_manager.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 HistoryService* history_service = HistoryServiceFactory::GetForProfile( 303 HistoryService* history_service = HistoryServiceFactory::GetForProfile(
302 profile_, ServiceAccessType::EXPLICIT_ACCESS); 304 profile_, ServiceAccessType::EXPLICIT_ACCESS);
303 if (history_service) { 305 if (history_service) {
304 std::set<GURL> restrict_urls; 306 std::set<GURL> restrict_urls;
305 if (!remove_origin_.is_empty()) 307 if (!remove_origin_.is_empty())
306 restrict_urls.insert(remove_origin_); 308 restrict_urls.insert(remove_origin_);
307 content::RecordAction(UserMetricsAction("ClearBrowsingData_History")); 309 content::RecordAction(UserMetricsAction("ClearBrowsingData_History"));
308 waiting_for_clear_history_ = true; 310 waiting_for_clear_history_ = true;
309 311
310 history_service->ExpireLocalAndRemoteHistoryBetween( 312 history_service->ExpireLocalAndRemoteHistoryBetween(
311 restrict_urls, delete_begin_, delete_end_, 313 WebHistoryServiceFactory::GetForProfile(profile_), restrict_urls,
314 delete_begin_, delete_end_,
312 base::Bind(&BrowsingDataRemover::OnHistoryDeletionDone, 315 base::Bind(&BrowsingDataRemover::OnHistoryDeletionDone,
313 base::Unretained(this)), 316 base::Unretained(this)),
314 &history_task_tracker_); 317 &history_task_tracker_);
315 318
316 #if defined(ENABLE_EXTENSIONS) 319 #if defined(ENABLE_EXTENSIONS)
317 // The extension activity contains details of which websites extensions 320 // The extension activity contains details of which websites extensions
318 // were active on. It therefore indirectly stores details of websites a 321 // were active on. It therefore indirectly stores details of websites a
319 // user has visited so best clean from here as well. 322 // user has visited so best clean from here as well.
320 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs(restrict_urls); 323 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs(restrict_urls);
321 #endif 324 #endif
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 waiting_for_clear_domain_reliability_monitor_ = false; 1218 waiting_for_clear_domain_reliability_monitor_ = false;
1216 NotifyAndDeleteIfDone(); 1219 NotifyAndDeleteIfDone();
1217 } 1220 }
1218 1221
1219 // static 1222 // static
1220 BrowsingDataRemover::CallbackSubscription 1223 BrowsingDataRemover::CallbackSubscription
1221 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( 1224 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback(
1222 const BrowsingDataRemover::Callback& callback) { 1225 const BrowsingDataRemover::Callback& callback) {
1223 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); 1226 return GetOnBrowsingDataRemovedCallbacks()->Add(callback);
1224 } 1227 }
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