| 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 48b24383a843898d7f95e5edeb350ae7a3107737..beb199bed4e14d733cb5bfd07c892a619d72dd11 100644
|
| --- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
|
| +++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
|
| @@ -122,9 +122,6 @@ NewTabUI::NewTabUI(content::WebUI* web_ui)
|
| web_ui->AddMessageHandler(new FaviconWebUIHandler());
|
| }
|
|
|
| - if (NTPLoginHandler::ShouldShow(GetProfile()))
|
| - web_ui->AddMessageHandler(new NTPLoginHandler());
|
| -
|
| // Initializing the CSS and HTML can require some CPU, so do it after
|
| // we've hooked up the most visited handler. This allows the DB query
|
| // for the new tab thumbs to happen earlier.
|
| @@ -135,10 +132,16 @@ NewTabUI::NewTabUI(content::WebUI* web_ui)
|
|
|
| pref_change_registrar_.Init(GetProfile()->GetPrefs());
|
| pref_change_registrar_.Add(prefs::kShowBookmarkBar, this);
|
| +
|
| +#if !defined(OS_ANDROID)
|
| + if (NTPLoginHandler::ShouldShow(GetProfile()))
|
| + web_ui->AddMessageHandler(new NTPLoginHandler());
|
| +
|
| // Listen for theme installation.
|
| registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
|
| content::Source<ThemeService>(
|
| ThemeServiceFactory::GetForProfile(GetProfile())));
|
| +#endif
|
| }
|
|
|
| NewTabUI::~NewTabUI() {
|
| @@ -206,6 +209,7 @@ void NewTabUI::Observe(int type,
|
| web_ui()->CallJavascriptFunction("ntp.setBookmarkBarAttached", attached);
|
| break;
|
| }
|
| +#if !defined(OS_ANDROID)
|
| case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: {
|
| InitializeCSSCaches();
|
| StringValue attribution(
|
| @@ -214,6 +218,7 @@ void NewTabUI::Observe(int type,
|
| web_ui()->CallJavascriptFunction("ntp.themeChanged", attribution);
|
| break;
|
| }
|
| +#endif
|
| case content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT: {
|
| last_paint_ = base::TimeTicks::Now();
|
| break;
|
| @@ -224,9 +229,11 @@ void NewTabUI::Observe(int type,
|
| }
|
|
|
| void NewTabUI::InitializeCSSCaches() {
|
| +#if !defined(OS_ANDROID)
|
| Profile* profile = GetProfile();
|
| ThemeSource* theme = new ThemeSource(profile);
|
| profile->GetChromeURLDataManager()->AddDataSource(theme);
|
| +#endif
|
| }
|
|
|
| // static
|
|
|