Index: chrome/browser/ui/webui/ntp/new_tab_ui.cc |
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
index bf78cd0540a8b9bc919465796ad41bb93f9eae66..d78b3057d786d09ef1fafca016adcccfecda86af 100644 |
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
@@ -249,13 +249,6 @@ void NewTabUI::Observe(int type, |
const content::NotificationSource& source, |
const content::NotificationDetails& details) { |
switch (type) { |
- case chrome::NOTIFICATION_PREF_CHANGED: { // kShowBookmarkBar |
- StringValue attached( |
- GetProfile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ? |
- "true" : "false"); |
- web_ui()->CallJavascriptFunction("ntp.setBookmarkBarAttached", attached); |
- break; |
- } |
#if defined(ENABLE_THEMES) |
case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: { |
InitializeCSSCaches(); |
@@ -288,6 +281,14 @@ void NewTabUI::Observe(int type, |
} |
} |
+void NewTabUI::OnPreferenceChanged(PrefServiceBase* service, |
+ const std::string& pref_name) { |
+ StringValue attached( |
+ GetProfile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ? |
+ "true" : "false"); |
Mattias Nissler (ping if slow)
2012/10/31 13:29:36
indentation
Jói
2012/10/31 14:56:26
Done.
|
+ web_ui()->CallJavascriptFunction("ntp.setBookmarkBarAttached", attached); |
+} |
+ |
void NewTabUI::InitializeCSSCaches() { |
#if defined(ENABLE_THEMES) |
Profile* profile = GetProfile(); |