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

Unified Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.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/webui/ntp/app_launcher_handler.h ('k') | chrome/browser/ui/webui/ntp/new_tab_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/app_launcher_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index 701a5e2370d616d50240e84549e8a6415819e28b..d701b2042775125e754eda12e3735e12bcbb7695 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -312,13 +312,6 @@ void AppLauncherHandler::Observe(int type,
// TODO(estade): Try to get rid of this inefficient operation.
HandleGetApps(NULL);
break;
- case chrome::NOTIFICATION_PREF_CHANGED: {
- DictionaryValue dictionary;
- FillAppDictionary(&dictionary);
- web_ui()->CallJavascriptFunction("ntp.appsPrefChangeCallback",
- dictionary);
- break;
- }
case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR: {
CrxInstaller* crx_installer = content::Source<CrxInstaller>(source).ptr();
if (!Profile::FromWebUI(web_ui())->IsSameProfile(
@@ -336,6 +329,14 @@ void AppLauncherHandler::Observe(int type,
}
}
+void AppLauncherHandler::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
+ DictionaryValue dictionary;
+ FillAppDictionary(&dictionary);
+ web_ui()->CallJavascriptFunction("ntp.appsPrefChangeCallback",
+ dictionary);
+}
+
void AppLauncherHandler::FillAppDictionary(DictionaryValue* dictionary) {
// CreateAppInfo and ClearOrdinals can change the extension prefs.
AutoReset<bool> auto_reset(&ignore_changes_, true);
« no previous file with comments | « chrome/browser/ui/webui/ntp/app_launcher_handler.h ('k') | chrome/browser/ui/webui/ntp/new_tab_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698