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 6dd6b64c6896318dead142b077a5459d870b6c56..900f7475be7bffe7cc4c7a3098db27f53d3fb123 100644 |
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
@@ -34,6 +34,7 @@ |
#include "chrome/browser/ui/webui/ntp/foreign_session_handler.h" |
#include "chrome/browser/ui/webui/ntp/most_visited_handler.h" |
#include "chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h" |
+#include "chrome/browser/ui/webui/ntp/new_tab_sync_setup_handler.h" |
#include "chrome/browser/ui/webui/ntp/ntp_login_handler.h" |
#include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h" |
#include "chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h" |
@@ -386,7 +387,8 @@ NewTabUI::NewTabUI(TabContents* contents) |
if (!GetProfile()->IsOffTheRecord()) { |
PrefService* pref_service = GetProfile()->GetPrefs(); |
- AddMessageHandler((new NTPLoginHandler())->Attach(this)); |
+ if (!NewTabSyncSetupHandler::ShouldShowSyncPromo()) |
+ AddMessageHandler((new NTPLoginHandler())->Attach(this)); |
AddMessageHandler((new ShownSectionsHandler(pref_service))->Attach(this)); |
AddMessageHandler((new browser_sync::ForeignSessionHandler())-> |
Attach(this)); |
@@ -407,6 +409,10 @@ NewTabUI::NewTabUI(TabContents* contents) |
AddMessageHandler((new FaviconWebUIHandler())->Attach(this)); |
} |
+ // Add the sync setup handler for the sync promo UI. |
+ scoped_ptr<SyncSetupHandler> handler(new NewTabSyncSetupHandler()); |
+ AddMessageHandler(handler.release()->Attach(this)); |
+ |
// 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. |