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

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

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit 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
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4d0fe51a39f5b50743733c84b361cd1efb0d4be7..cd8aef2ceaf0273e710ac54edd900434001b6c11 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
@@ -784,25 +784,25 @@ void ChromeLauncherController::Observe(
app_icon_loader_->ClearImage(extension->id());
break;
}
- case chrome::NOTIFICATION_PREF_CHANGED: {
- const std::string& pref_name(
- *content::Details<std::string>(details).ptr());
- if (pref_name == prefs::kPinnedLauncherApps) {
- UpdateAppLaunchersFromPref();
- } else if (pref_name == prefs::kShelfAlignmentLocal) {
- SetShelfAlignmentFromPrefs();
- } else if (pref_name == prefs::kShelfAutoHideBehaviorLocal) {
- SetShelfAutoHideBehaviorFromPrefs();
- } else {
- NOTREACHED() << "Unexpected pref change for " << pref_name;
- }
- break;
- }
default:
NOTREACHED() << "Unexpected notification type=" << type;
}
}
+void ChromeLauncherController::OnPreferenceChanged(
+ PrefServiceBase* service,
+ const std::string& pref_name) {
+ if (pref_name == prefs::kPinnedLauncherApps) {
+ UpdateAppLaunchersFromPref();
+ } else if (pref_name == prefs::kShelfAlignmentLocal) {
+ SetShelfAlignmentFromPrefs();
+ } 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.
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698