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

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

Issue 2816723002: Add "Site Settings" option to Clear Browsing Data on Android (Closed)
Patch Set: Fix failing test on Android due to HCSM being created before FeatureList Created 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/chrome_browsing_data_remover_delegate.h" 5 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 29 matching lines...) Expand all
40 #include "chrome/browser/search_engines/template_url_service_factory.h" 40 #include "chrome/browser/search_engines/template_url_service_factory.h"
41 #include "chrome/browser/sessions/tab_restore_service_factory.h" 41 #include "chrome/browser/sessions/tab_restore_service_factory.h"
42 #include "chrome/browser/translate/language_model_factory.h" 42 #include "chrome/browser/translate/language_model_factory.h"
43 #include "chrome/browser/web_data_service_factory.h" 43 #include "chrome/browser/web_data_service_factory.h"
44 #include "chrome/common/features.h" 44 #include "chrome/common/features.h"
45 #include "chrome/common/pref_names.h" 45 #include "chrome/common/pref_names.h"
46 #include "chrome/common/url_constants.h" 46 #include "chrome/common/url_constants.h"
47 #include "components/autofill/core/browser/personal_data_manager.h" 47 #include "components/autofill/core/browser/personal_data_manager.h"
48 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" 48 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
49 #include "components/bookmarks/browser/bookmark_model.h" 49 #include "components/bookmarks/browser/bookmark_model.h"
50 #include "components/content_settings/core/browser/content_settings_registry.h"
50 #include "components/content_settings/core/browser/host_content_settings_map.h" 51 #include "components/content_settings/core/browser/host_content_settings_map.h"
51 #include "components/content_settings/core/common/content_settings.h" 52 #include "components/content_settings/core/common/content_settings.h"
52 #include "components/content_settings/core/common/content_settings_pattern.h" 53 #include "components/content_settings/core/common/content_settings_pattern.h"
53 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h" 54 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h"
54 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv ice.h" 55 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv ice.h"
55 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" 56 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h"
56 #include "components/domain_reliability/service.h" 57 #include "components/domain_reliability/service.h"
57 #include "components/history/core/browser/history_service.h" 58 #include "components/history/core/browser/history_service.h"
58 #include "components/nacl/browser/nacl_browser.h" 59 #include "components/nacl/browser/nacl_browser.h"
59 #include "components/nacl/browser/pnacl_host.h" 60 #include "components/nacl/browser/pnacl_host.h"
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 &ChromeBrowsingDataRemoverDelegate::OnClearedCookies, 704 &ChromeBrowsingDataRemoverDelegate::OnClearedCookies,
704 weak_ptr_factory_.GetWeakPtr())))); 705 weak_ptr_factory_.GetWeakPtr()))));
705 } 706 }
706 } 707 }
707 } 708 }
708 709
709 MediaDeviceIDSalt::Reset(profile_->GetPrefs()); 710 MediaDeviceIDSalt::Reset(profile_->GetPrefs());
710 } 711 }
711 712
712 ////////////////////////////////////////////////////////////////////////////// 713 //////////////////////////////////////////////////////////////////////////////
714 // DATA_TYPE_CONTENT_SETTINGS
715 if (remove_mask & DATA_TYPE_CONTENT_SETTINGS) {
716 auto* registry = content_settings::ContentSettingsRegistry::GetInstance();
msramek 2017/05/08 10:53:56 nit: const
dullweber 2017/05/08 15:50:23 Done.
717 auto* map = HostContentSettingsMapFactory::GetForProfile(profile_);
718 for (const content_settings::ContentSettingsInfo* info : *registry) {
719 map->ClearSettingsForOneTypeWithPredicate(
720 info->website_settings_info()->type(), delete_begin_,
721 base::Bind(&WebsiteSettingsFilterAdapter, filter));
722 }
723 }
724
725 //////////////////////////////////////////////////////////////////////////////
713 // DATA_TYPE_DURABLE_PERMISSION 726 // DATA_TYPE_DURABLE_PERMISSION
714 if (remove_mask & DATA_TYPE_DURABLE_PERMISSION) { 727 if (remove_mask & DATA_TYPE_DURABLE_PERMISSION) {
715 HostContentSettingsMapFactory::GetForProfile(profile_) 728 HostContentSettingsMapFactory::GetForProfile(profile_)
716 ->ClearSettingsForOneTypeWithPredicate( 729 ->ClearSettingsForOneTypeWithPredicate(
717 CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, base::Time(), 730 CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, base::Time(),
718 base::Bind(&WebsiteSettingsFilterAdapter, filter)); 731 base::Bind(&WebsiteSettingsFilterAdapter, filter));
719 } 732 }
720 733
721 ////////////////////////////////////////////////////////////////////////////// 734 //////////////////////////////////////////////////////////////////////////////
722 // DATA_TYPE_SITE_USAGE_DATA 735 // DATA_TYPE_SITE_USAGE_DATA
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 } 1157 }
1145 1158
1146 void ChromeBrowsingDataRemoverDelegate:: 1159 void ChromeBrowsingDataRemoverDelegate::
1147 OnDeauthorizeFlashContentLicensesCompleted( 1160 OnDeauthorizeFlashContentLicensesCompleted(
1148 uint32_t request_id, 1161 uint32_t request_id,
1149 bool /* success */) { 1162 bool /* success */) {
1150 DCHECK_EQ(request_id, deauthorize_flash_content_licenses_request_id_); 1163 DCHECK_EQ(request_id, deauthorize_flash_content_licenses_request_id_);
1151 clear_flash_content_licenses_.GetCompletionCallback().Run(); 1164 clear_flash_content_licenses_.GetCompletionCallback().Run();
1152 } 1165 }
1153 #endif 1166 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698