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

Unified Diff: chrome/browser/ui/webui/ntp/new_tab_ui.cc

Issue 7399015: Sync Promo: Add a way to collapse the sync promo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review feedback Created 9 years, 5 months 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
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.

Powered by Google App Engine
This is Rietveld 408576698