Commit df40ea01 authored by Charlie Hu's avatar Charlie Hu Committed by Commit Bot

[CodeHealthRotation] Migrate |PerfMember::Init| calls from base::Bind to base::BindRepeating

|PerfMember::Init| accepts an instance of |base::RepeatingClosure| as
its last parameter. Call sites should use |base::BindRepeating|.

Bug: 1007635
Change-Id: I7be18e3614984c74767950b0239457be87499328
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2521777Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Charlie Hu <chenleihu@google.com>
Cr-Commit-Position: refs/heads/master@{#824975}
parent 79f876ff
...@@ -48,9 +48,8 @@ NotifierStateTracker::NotifierStateTracker(Profile* profile) ...@@ -48,9 +48,8 @@ NotifierStateTracker::NotifierStateTracker(Profile* profile)
prefs::kMessageCenterDisabledExtensionIds, &disabled_extension_ids_); prefs::kMessageCenterDisabledExtensionIds, &disabled_extension_ids_);
disabled_extension_id_pref_.Init( disabled_extension_id_pref_.Init(
prefs::kMessageCenterDisabledExtensionIds, prefs::kMessageCenterDisabledExtensionIds, profile_->GetPrefs(),
profile_->GetPrefs(), base::BindRepeating(
base::Bind(
&NotifierStateTracker::OnStringListPrefChanged, &NotifierStateTracker::OnStringListPrefChanged,
base::Unretained(this), base::Unretained(this),
base::Unretained(prefs::kMessageCenterDisabledExtensionIds), base::Unretained(prefs::kMessageCenterDisabledExtensionIds),
......
...@@ -178,8 +178,8 @@ BrowserCommandController::BrowserCommandController(Browser* browser) ...@@ -178,8 +178,8 @@ BrowserCommandController::BrowserCommandController(Browser* browser)
#endif #endif
pref_signin_allowed_.Init( pref_signin_allowed_.Init(
prefs::kSigninAllowed, profile()->GetOriginalProfile()->GetPrefs(), prefs::kSigninAllowed, profile()->GetOriginalProfile()->GetPrefs(),
base::Bind(&BrowserCommandController::OnSigninAllowedPrefChange, base::BindRepeating(&BrowserCommandController::OnSigninAllowedPrefChange,
base::Unretained(this))); base::Unretained(this)));
InitCommandState(); InitCommandState();
......
...@@ -21,8 +21,9 @@ DesktopBrowserFrameAuraLinux::DesktopBrowserFrameAuraLinux( ...@@ -21,8 +21,9 @@ DesktopBrowserFrameAuraLinux::DesktopBrowserFrameAuraLinux(
use_custom_frame_pref_.Init( use_custom_frame_pref_.Init(
prefs::kUseCustomChromeFrame, prefs::kUseCustomChromeFrame,
browser_view->browser()->profile()->GetPrefs(), browser_view->browser()->profile()->GetPrefs(),
base::Bind(&DesktopBrowserFrameAuraLinux::OnUseCustomChromeFrameChanged, base::BindRepeating(
base::Unretained(this))); &DesktopBrowserFrameAuraLinux::OnUseCustomChromeFrameChanged,
base::Unretained(this)));
} }
DesktopBrowserFrameAuraLinux::~DesktopBrowserFrameAuraLinux() {} DesktopBrowserFrameAuraLinux::~DesktopBrowserFrameAuraLinux() {}
......
...@@ -355,9 +355,9 @@ ExtensionsUI::ExtensionsUI(content::WebUI* web_ui) ...@@ -355,9 +355,9 @@ ExtensionsUI::ExtensionsUI(content::WebUI* web_ui)
Profile* profile = Profile::FromWebUI(web_ui); Profile* profile = Profile::FromWebUI(web_ui);
content::WebUIDataSource* source = nullptr; content::WebUIDataSource* source = nullptr;
in_dev_mode_.Init( in_dev_mode_.Init(prefs::kExtensionsUIDeveloperMode, profile->GetPrefs(),
prefs::kExtensionsUIDeveloperMode, profile->GetPrefs(), base::BindRepeating(&ExtensionsUI::OnDevModeChanged,
base::Bind(&ExtensionsUI::OnDevModeChanged, base::Unretained(this))); base::Unretained(this)));
source = CreateMdExtensionsSource(profile, *in_dev_mode_); source = CreateMdExtensionsSource(profile, *in_dev_mode_);
ManagedUIHandler::Initialize(web_ui, source); ManagedUIHandler::Initialize(web_ui, source);
......
...@@ -549,9 +549,9 @@ bool LocalDiscoveryUIHandler::IsUserProfileRestricted() { ...@@ -549,9 +549,9 @@ bool LocalDiscoveryUIHandler::IsUserProfileRestricted() {
void LocalDiscoveryUIHandler::StartCloudPrintConnector() { void LocalDiscoveryUIHandler::StartCloudPrintConnector() {
Profile* profile = Profile::FromWebUI(web_ui()); Profile* profile = Profile::FromWebUI(web_ui());
base::Closure cloud_print_callback = base::Bind( base::Closure cloud_print_callback =
&LocalDiscoveryUIHandler::OnCloudPrintPrefsChanged, base::BindRepeating(&LocalDiscoveryUIHandler::OnCloudPrintPrefsChanged,
base::Unretained(this)); base::Unretained(this));
if (cloud_print_connector_email_.GetPrefName().empty()) { if (cloud_print_connector_email_.GetPrefName().empty()) {
cloud_print_connector_email_.Init( cloud_print_connector_email_.Init(
......
...@@ -26,8 +26,10 @@ ProfileInfoWatcher::ProfileInfoWatcher( ...@@ -26,8 +26,10 @@ ProfileInfoWatcher::ProfileInfoWatcher(
if (profile_manager) if (profile_manager)
profile_manager->GetProfileAttributesStorage().AddObserver(this); profile_manager->GetProfileAttributesStorage().AddObserver(this);
signin_allowed_pref_.Init(prefs::kSigninAllowed, profile_->GetPrefs(), signin_allowed_pref_.Init(
base::Bind(&ProfileInfoWatcher::RunCallback, base::Unretained(this))); prefs::kSigninAllowed, profile_->GetPrefs(),
base::BindRepeating(&ProfileInfoWatcher::RunCallback,
base::Unretained(this)));
} }
ProfileInfoWatcher::~ProfileInfoWatcher() { ProfileInfoWatcher::~ProfileInfoWatcher() {
......
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