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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc

Issue 11280115: Remove PrefObserver usages, batch 12. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review. Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
index 6a0cfd173b2c2ef47e5d794172b04aff1990213f..777e978eaa07af528591726280203c5f12f0e0c4 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
@@ -175,7 +175,10 @@ ChromeLauncherController::ChromeLauncherController(Profile* profile,
chrome::NOTIFICATION_EXTENSION_UNLOADED,
content::Source<Profile>(profile_));
pref_change_registrar_.Init(profile_->GetPrefs());
- pref_change_registrar_.Add(prefs::kPinnedLauncherApps, this);
+ pref_change_registrar_.Add(
+ prefs::kPinnedLauncherApps,
+ base::Bind(&ChromeLauncherController::UpdateAppLaunchersFromPref,
+ base::Unretained(this)));
}
ChromeLauncherController::~ChromeLauncherController() {
@@ -777,20 +780,6 @@ void ChromeLauncherController::Observe(
}
}
-void ChromeLauncherController::OnPreferenceChanged(
- PrefServiceBase* service,
- const std::string& pref_name) {
- if (pref_name == prefs::kPinnedLauncherApps) {
- UpdateAppLaunchersFromPref();
- } else if (pref_name == prefs::kShelfAlignmentLocal) {
- SetShelfAlignmentFromPrefs();
Mattias Nissler (ping if slow) 2012/11/21 11:31:04 Hm, maybe the code is missing pref change notifica
Jói 2012/11/21 12:59:33 davemoore: Do you know? The code prior to this cha
sky 2012/11/29 01:49:02 See line 236 old.
- } else if (pref_name == prefs::kShelfAutoHideBehaviorLocal) {
- SetShelfAutoHideBehaviorFromPrefs();
- } else {
- NOTREACHED() << "Unexpected pref change for " << pref_name;
- }
-}
-
void ChromeLauncherController::OnShelfAlignmentChanged() {
const char* pref_value = NULL;
// TODO(oshima): Support multiple displays.

Powered by Google App Engine
This is Rietveld 408576698