Commit 721ba87f authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

Convert base::Bind in chrome/browser/content_settings/

This is a code health CL, no behavior change is expected.

Bug: 1007635
Change-Id: Ic793ddb23fd4bc61a8f27450277d2a1fd02fc632
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2276243
Commit-Queue: Raymes Khoury <raymes@chromium.org>
Reviewed-by: default avatarRaymes Khoury <raymes@chromium.org>
Auto-Submit: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784186}
parent bcc34d37
...@@ -73,7 +73,7 @@ class DeadlockCheckerObserver { ...@@ -73,7 +73,7 @@ class DeadlockCheckerObserver {
const ContentSettingsPref* pref = pair.second.get(); const ContentSettingsPref* pref = pair.second.get();
pref_change_registrar_.Add( pref_change_registrar_.Add(
registry->Get(pair.first)->pref_name(), registry->Get(pair.first)->pref_name(),
base::Bind( base::BindRepeating(
&DeadlockCheckerObserver::OnContentSettingsPatternPairsChanged, &DeadlockCheckerObserver::OnContentSettingsPatternPairsChanged,
base::Unretained(this), base::Unretained(pref))); base::Unretained(this), base::Unretained(pref)));
} }
......
...@@ -55,9 +55,10 @@ SupervisedProvider::SupervisedProvider( ...@@ -55,9 +55,10 @@ SupervisedProvider::SupervisedProvider(
// This means this will get destroyed before the SUSS and will be // This means this will get destroyed before the SUSS and will be
// unsubscribed from it. // unsubscribed from it.
user_settings_subscription_ = user_settings_subscription_ =
supervised_user_settings_service->SubscribeForSettingsChange(base::Bind( supervised_user_settings_service->SubscribeForSettingsChange(
&content_settings::SupervisedProvider::OnSupervisedSettingsAvailable, base::BindRepeating(&content_settings::SupervisedProvider::
base::Unretained(this))); OnSupervisedSettingsAvailable,
base::Unretained(this)));
} }
SupervisedProvider::~SupervisedProvider() { SupervisedProvider::~SupervisedProvider() {
......
...@@ -110,12 +110,12 @@ GeneratedCookiePrefBase::GeneratedCookiePrefBase(Profile* profile, ...@@ -110,12 +110,12 @@ GeneratedCookiePrefBase::GeneratedCookiePrefBase(Profile* profile,
user_prefs_registrar_.Init(profile->GetPrefs()); user_prefs_registrar_.Init(profile->GetPrefs());
user_prefs_registrar_.Add( user_prefs_registrar_.Add(
prefs::kBlockThirdPartyCookies, prefs::kBlockThirdPartyCookies,
base::Bind(&GeneratedCookiePrefBase::OnCookiePreferencesChanged, base::BindRepeating(&GeneratedCookiePrefBase::OnCookiePreferencesChanged,
base::Unretained(this))); base::Unretained(this)));
user_prefs_registrar_.Add( user_prefs_registrar_.Add(
prefs::kCookieControlsMode, prefs::kCookieControlsMode,
base::Bind(&GeneratedCookiePrefBase::OnCookiePreferencesChanged, base::BindRepeating(&GeneratedCookiePrefBase::OnCookiePreferencesChanged,
base::Unretained(this))); base::Unretained(this)));
} }
GeneratedCookiePrefBase::~GeneratedCookiePrefBase() = default; GeneratedCookiePrefBase::~GeneratedCookiePrefBase() = default;
......
...@@ -973,7 +973,6 @@ TEST_F(HostContentSettingsMapTest, IncognitoPartialInheritPref) { ...@@ -973,7 +973,6 @@ TEST_F(HostContentSettingsMapTest, IncognitoPartialInheritPref) {
// GetSettingsForOneType should return preference followed by default, both inherited. // GetSettingsForOneType should return preference followed by default, both inherited.
{ {
ContentSettingsForOneType otr_settings; ContentSettingsForOneType otr_settings;
otr_map->GetSettingsForOneType(ContentSettingsType::MEDIASTREAM_MIC, otr_map->GetSettingsForOneType(ContentSettingsType::MEDIASTREAM_MIC,
std::string(), &otr_settings); std::string(), &otr_settings);
...@@ -1001,8 +1000,8 @@ TEST_F(HostContentSettingsMapTest, IncognitoPartialInheritPref) { ...@@ -1001,8 +1000,8 @@ TEST_F(HostContentSettingsMapTest, IncognitoPartialInheritPref) {
otr_map->GetContentSetting( otr_map->GetContentSetting(
host, host, ContentSettingsType::MEDIASTREAM_MIC, std::string())); host, host, ContentSettingsType::MEDIASTREAM_MIC, std::string()));
// The inherited ALLOW gets turned back into ASK in GetSettingsForOneType, mirroring the // The inherited ALLOW gets turned back into ASK in GetSettingsForOneType,
// reverting to ASK behavior above. // mirroring the reverting to ASK behavior above.
{ {
ContentSettingsForOneType otr_settings; ContentSettingsForOneType otr_settings;
otr_map->GetSettingsForOneType(ContentSettingsType::MEDIASTREAM_MIC, otr_map->GetSettingsForOneType(ContentSettingsType::MEDIASTREAM_MIC,
...@@ -1572,7 +1571,7 @@ TEST_F(HostContentSettingsMapTest, ClearSettingsForOneTypeWithPredicate) { ...@@ -1572,7 +1571,7 @@ TEST_F(HostContentSettingsMapTest, ClearSettingsForOneTypeWithPredicate) {
// First, test that we clear only COOKIES (not APP_BANNER), and pattern2. // First, test that we clear only COOKIES (not APP_BANNER), and pattern2.
host_content_settings_map->ClearSettingsForOneTypeWithPredicate( host_content_settings_map->ClearSettingsForOneTypeWithPredicate(
ContentSettingsType::COOKIES, base::Time(), base::Time::Max(), ContentSettingsType::COOKIES, base::Time(), base::Time::Max(),
base::Bind(&MatchPrimaryPattern, pattern2)); base::BindRepeating(&MatchPrimaryPattern, pattern2));
host_content_settings_map->GetSettingsForOneType( host_content_settings_map->GetSettingsForOneType(
ContentSettingsType::COOKIES, std::string(), &host_settings); ContentSettingsType::COOKIES, std::string(), &host_settings);
// |host_settings| contains default & block. // |host_settings| contains default & block.
...@@ -1617,7 +1616,7 @@ TEST_F(HostContentSettingsMapTest, ClearSettingsForOneTypeWithPredicate) { ...@@ -1617,7 +1616,7 @@ TEST_F(HostContentSettingsMapTest, ClearSettingsForOneTypeWithPredicate) {
ContentSettingsPattern::FromURLNoWildcard(url3_origin_only); ContentSettingsPattern::FromURLNoWildcard(url3_origin_only);
host_content_settings_map->ClearSettingsForOneTypeWithPredicate( host_content_settings_map->ClearSettingsForOneTypeWithPredicate(
ContentSettingsType::SITE_ENGAGEMENT, base::Time(), base::Time::Max(), ContentSettingsType::SITE_ENGAGEMENT, base::Time(), base::Time::Max(),
base::Bind(&MatchPrimaryPattern, http_pattern)); base::BindRepeating(&MatchPrimaryPattern, http_pattern));
// Verify we only have one, and it's url1. // Verify we only have one, and it's url1.
host_content_settings_map->GetSettingsForOneType( host_content_settings_map->GetSettingsForOneType(
ContentSettingsType::SITE_ENGAGEMENT, std::string(), &host_settings); ContentSettingsType::SITE_ENGAGEMENT, std::string(), &host_settings);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment