| 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 fe80f87cd8011e89ddd40a72a1eb23d945fdd3fc..2a5e29571cc7656e9472e122dcc608cb46505c4c 100644
|
| --- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
|
| +++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
|
| @@ -133,6 +133,8 @@ NewTabUI::NewTabUI(content::WebUI* web_ui)
|
| new NewTabHTMLSource(GetProfile()->GetOriginalProfile());
|
| GetProfile()->GetChromeURLDataManager()->AddDataSource(html_source);
|
|
|
| + pref_change_registrar_.Init(GetProfile()->GetPrefs());
|
| + pref_change_registrar_.Add(prefs::kShowBookmarkBar, this);
|
| // Listen for theme installation.
|
| registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
|
| content::Source<ThemeService>(
|
| @@ -197,14 +199,19 @@ 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("ntp4.setBookmarkBarAttached", attached);
|
| + break;
|
| + }
|
| case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: {
|
| InitializeCSSCaches();
|
| - ListValue args;
|
| - args.Append(Value::CreateStringValue(
|
| + StringValue attribution(
|
| ThemeServiceFactory::GetForProfile(GetProfile())->HasCustomImage(
|
| - IDR_THEME_NTP_ATTRIBUTION) ?
|
| - "true" : "false"));
|
| - web_ui()->CallJavascriptFunction("themeChanged", args);
|
| + IDR_THEME_NTP_ATTRIBUTION) ? "true" : "false");
|
| + web_ui()->CallJavascriptFunction("themeChanged", attribution);
|
| break;
|
| }
|
| case content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT: {
|
| @@ -244,7 +251,6 @@ void NewTabUI::SetupFieldTrials() {
|
| g_hint_group = trial->AppendGroup("PlusIcon", 40);
|
| }
|
|
|
| -
|
| // static
|
| bool NewTabUI::ShouldShowWebStoreFooterLink() {
|
| const CommandLine* cli = CommandLine::ForCurrentProcess();
|
|
|