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/metrics/histogram_macros.h" | 15 #include "base/metrics/histogram_macros.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 17 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
19 #include "chrome/browser/browsing_data/browsing_data_filter_builder.h" | 19 #include "chrome/browser/browsing_data/browsing_data_filter_builder.h" |
20 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 20 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
21 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" | 21 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" |
22 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h" | 22 #include "chrome/browser/browsing_data/registrable_domain_filter_builder.h" |
23 #include "chrome/browser/chrome_notification_types.h" | 23 #include "chrome/browser/chrome_notification_types.h" |
24 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 24 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
25 #include "chrome/browser/domain_reliability/service_factory.h" | 25 #include "chrome/browser/domain_reliability/service_factory.h" |
26 #include "chrome/browser/download/download_prefs.h" | 26 #include "chrome/browser/download/download_prefs.h" |
27 #include "chrome/browser/history/history_service_factory.h" | 27 #include "chrome/browser/history/history_service_factory.h" |
28 #include "chrome/browser/history/web_history_service_factory.h" | 28 #include "chrome/browser/history/web_history_service_factory.h" |
29 #include "chrome/browser/io_thread.h" | 29 #include "chrome/browser/io_thread.h" |
30 #include "chrome/browser/media/media_device_id_salt.h" | |
31 #include "chrome/browser/net/predictor.h" | 30 #include "chrome/browser/net/predictor.h" |
32 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 31 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
33 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" | 32 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" |
34 #include "chrome/browser/password_manager/password_store_factory.h" | 33 #include "chrome/browser/password_manager/password_store_factory.h" |
35 #include "chrome/browser/prerender/prerender_manager.h" | 34 #include "chrome/browser/prerender/prerender_manager.h" |
36 #include "chrome/browser/prerender/prerender_manager_factory.h" | 35 #include "chrome/browser/prerender/prerender_manager_factory.h" |
37 #include "chrome/browser/profiles/profile.h" | 36 #include "chrome/browser/profiles/profile.h" |
38 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 37 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
39 #include "chrome/browser/search_engines/template_url_service_factory.h" | 38 #include "chrome/browser/search_engines/template_url_service_factory.h" |
40 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 39 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
41 #include "chrome/browser/web_data_service_factory.h" | 40 #include "chrome/browser/web_data_service_factory.h" |
42 #include "chrome/common/features.h" | 41 #include "chrome/common/features.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/browsing_data/storage_partition_http_cache_data_remover.h" | 46 #include "components/browsing_data/storage_partition_http_cache_data_remover.h" |
48 #include "components/content_settings/core/browser/host_content_settings_map.h" | 47 #include "components/content_settings/core/browser/host_content_settings_map.h" |
49 #include "components/content_settings/core/common/content_settings.h" | 48 #include "components/content_settings/core/common/content_settings.h" |
50 #include "components/content_settings/core/common/content_settings_pattern.h" | 49 #include "components/content_settings/core/common/content_settings_pattern.h" |
51 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp
ression_stats.h" | 50 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp
ression_stats.h" |
52 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv
ice.h" | 51 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv
ice.h" |
53 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" | 52 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" |
54 #include "components/domain_reliability/service.h" | 53 #include "components/domain_reliability/service.h" |
55 #include "components/history/core/browser/history_service.h" | 54 #include "components/history/core/browser/history_service.h" |
| 55 #include "components/media_device_id_salt/media_device_id_salt.h" |
56 #include "components/nacl/browser/nacl_browser.h" | 56 #include "components/nacl/browser/nacl_browser.h" |
57 #include "components/nacl/browser/pnacl_host.h" | 57 #include "components/nacl/browser/pnacl_host.h" |
58 #include "components/omnibox/browser/omnibox_pref_names.h" | 58 #include "components/omnibox/browser/omnibox_pref_names.h" |
59 #include "components/password_manager/core/browser/password_store.h" | 59 #include "components/password_manager/core/browser/password_store.h" |
60 #include "components/power/origin_power_map.h" | 60 #include "components/power/origin_power_map.h" |
61 #include "components/power/origin_power_map_factory.h" | 61 #include "components/power/origin_power_map_factory.h" |
62 #include "components/prefs/pref_service.h" | 62 #include "components/prefs/pref_service.h" |
63 #include "components/search_engines/template_url_service.h" | 63 #include "components/search_engines/template_url_service.h" |
64 #include "components/sessions/core/tab_restore_service.h" | 64 #include "components/sessions/core/tab_restore_service.h" |
65 #include "components/web_cache/browser/web_cache_manager.h" | 65 #include "components/web_cache/browser/web_cache_manager.h" |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 base::Bind(&ClearCookiesWithPredicateOnIOThread, delete_begin_, | 666 base::Bind(&ClearCookiesWithPredicateOnIOThread, delete_begin_, |
667 delete_end_, filter_builder.BuildCookieFilter(), | 667 delete_end_, filter_builder.BuildCookieFilter(), |
668 base::RetainedRef(std::move(sb_context)), | 668 base::RetainedRef(std::move(sb_context)), |
669 UIThreadTrampoline( | 669 UIThreadTrampoline( |
670 base::Bind(&BrowsingDataRemover::OnClearedCookies, | 670 base::Bind(&BrowsingDataRemover::OnClearedCookies, |
671 weak_ptr_factory_.GetWeakPtr())))); | 671 weak_ptr_factory_.GetWeakPtr())))); |
672 } | 672 } |
673 } | 673 } |
674 } | 674 } |
675 | 675 |
676 MediaDeviceIDSalt::Reset(profile_->GetPrefs()); | 676 media_device_id_salt::MediaDeviceIDSalt::Reset(profile_->GetPrefs()); |
677 } | 677 } |
678 | 678 |
679 // Channel IDs are not separated for protected and unprotected web | 679 // Channel IDs are not separated for protected and unprotected web |
680 // origins. We check the origin_type_mask_ to prevent unintended deletion. | 680 // origins. We check the origin_type_mask_ to prevent unintended deletion. |
681 if (remove_mask & REMOVE_CHANNEL_IDS && | 681 if (remove_mask & REMOVE_CHANNEL_IDS && |
682 origin_type_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) { | 682 origin_type_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) { |
683 content::RecordAction( | 683 content::RecordAction( |
684 UserMetricsAction("ClearBrowsingData_ChannelIDs")); | 684 UserMetricsAction("ClearBrowsingData_ChannelIDs")); |
685 // Since we are running on the UI thread don't call GetURLRequestContext(). | 685 // Since we are running on the UI thread don't call GetURLRequestContext(). |
686 scoped_refptr<net::URLRequestContextGetter> rq_context = | 686 scoped_refptr<net::URLRequestContextGetter> rq_context = |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 waiting_for_clear_domain_reliability_monitor_ = false; | 1330 waiting_for_clear_domain_reliability_monitor_ = false; |
1331 NotifyIfDone(); | 1331 NotifyIfDone(); |
1332 } | 1332 } |
1333 | 1333 |
1334 // static | 1334 // static |
1335 BrowsingDataRemover::CallbackSubscription | 1335 BrowsingDataRemover::CallbackSubscription |
1336 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( | 1336 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( |
1337 const BrowsingDataRemover::Callback& callback) { | 1337 const BrowsingDataRemover::Callback& callback) { |
1338 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); | 1338 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); |
1339 } | 1339 } |
OLD | NEW |