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 {
const ContentSettingsPref* pref = pair.second.get();
pref_change_registrar_.Add(
registry->Get(pair.first)->pref_name(),
base::Bind(
base::BindRepeating(
&DeadlockCheckerObserver::OnContentSettingsPatternPairsChanged,
base::Unretained(this), base::Unretained(pref)));
}
......
......@@ -55,9 +55,10 @@ SupervisedProvider::SupervisedProvider(
// This means this will get destroyed before the SUSS and will be
// unsubscribed from it.
user_settings_subscription_ =
supervised_user_settings_service->SubscribeForSettingsChange(base::Bind(
&content_settings::SupervisedProvider::OnSupervisedSettingsAvailable,
base::Unretained(this)));
supervised_user_settings_service->SubscribeForSettingsChange(
base::BindRepeating(&content_settings::SupervisedProvider::
OnSupervisedSettingsAvailable,
base::Unretained(this)));
}
SupervisedProvider::~SupervisedProvider() {
......
......@@ -110,12 +110,12 @@ GeneratedCookiePrefBase::GeneratedCookiePrefBase(Profile* profile,
user_prefs_registrar_.Init(profile->GetPrefs());
user_prefs_registrar_.Add(
prefs::kBlockThirdPartyCookies,
base::Bind(&GeneratedCookiePrefBase::OnCookiePreferencesChanged,
base::Unretained(this)));
base::BindRepeating(&GeneratedCookiePrefBase::OnCookiePreferencesChanged,
base::Unretained(this)));
user_prefs_registrar_.Add(
prefs::kCookieControlsMode,
base::Bind(&GeneratedCookiePrefBase::OnCookiePreferencesChanged,
base::Unretained(this)));
base::BindRepeating(&GeneratedCookiePrefBase::OnCookiePreferencesChanged,
base::Unretained(this)));
}
GeneratedCookiePrefBase::~GeneratedCookiePrefBase() = default;
......
......@@ -973,7 +973,6 @@ TEST_F(HostContentSettingsMapTest, IncognitoPartialInheritPref) {
// GetSettingsForOneType should return preference followed by default, both inherited.
{
ContentSettingsForOneType otr_settings;
otr_map->GetSettingsForOneType(ContentSettingsType::MEDIASTREAM_MIC,
std::string(), &otr_settings);
......@@ -1001,8 +1000,8 @@ TEST_F(HostContentSettingsMapTest, IncognitoPartialInheritPref) {
otr_map->GetContentSetting(
host, host, ContentSettingsType::MEDIASTREAM_MIC, std::string()));
// The inherited ALLOW gets turned back into ASK in GetSettingsForOneType, mirroring the
// reverting to ASK behavior above.
// The inherited ALLOW gets turned back into ASK in GetSettingsForOneType,
// mirroring the reverting to ASK behavior above.
{
ContentSettingsForOneType otr_settings;
otr_map->GetSettingsForOneType(ContentSettingsType::MEDIASTREAM_MIC,
......@@ -1572,7 +1571,7 @@ TEST_F(HostContentSettingsMapTest, ClearSettingsForOneTypeWithPredicate) {
// First, test that we clear only COOKIES (not APP_BANNER), and pattern2.
host_content_settings_map->ClearSettingsForOneTypeWithPredicate(
ContentSettingsType::COOKIES, base::Time(), base::Time::Max(),
base::Bind(&MatchPrimaryPattern, pattern2));
base::BindRepeating(&MatchPrimaryPattern, pattern2));
host_content_settings_map->GetSettingsForOneType(
ContentSettingsType::COOKIES, std::string(), &host_settings);
// |host_settings| contains default & block.
......@@ -1617,7 +1616,7 @@ TEST_F(HostContentSettingsMapTest, ClearSettingsForOneTypeWithPredicate) {
ContentSettingsPattern::FromURLNoWildcard(url3_origin_only);
host_content_settings_map->ClearSettingsForOneTypeWithPredicate(
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.
host_content_settings_map->GetSettingsForOneType(
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