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