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

Side by Side 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: remove extra changes 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 7 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 if (NewTabUI::FirstRunDisabled()) 380 if (NewTabUI::FirstRunDisabled())
381 NewTabHTMLSource::set_first_run(false); 381 NewTabHTMLSource::set_first_run(false);
382 382
383 static bool first_view = true; 383 static bool first_view = true;
384 if (first_view) { 384 if (first_view) {
385 first_view = false; 385 first_view = false;
386 } 386 }
387 387
388 if (!GetProfile()->IsOffTheRecord()) { 388 if (!GetProfile()->IsOffTheRecord()) {
389 PrefService* pref_service = GetProfile()->GetPrefs(); 389 PrefService* pref_service = GetProfile()->GetPrefs();
390 AddMessageHandler((new NTPLoginHandler())->Attach(this)); 390 if (!NewTabSyncSetupHandler::ShouldShowSyncPromo())
391 AddMessageHandler((new NTPLoginHandler())->Attach(this));
391 AddMessageHandler((new ShownSectionsHandler(pref_service))->Attach(this)); 392 AddMessageHandler((new ShownSectionsHandler(pref_service))->Attach(this));
392 AddMessageHandler((new browser_sync::ForeignSessionHandler())-> 393 AddMessageHandler((new browser_sync::ForeignSessionHandler())->
393 Attach(this)); 394 Attach(this));
394 AddMessageHandler((new MostVisitedHandler())->Attach(this)); 395 AddMessageHandler((new MostVisitedHandler())->Attach(this));
395 AddMessageHandler((new RecentlyClosedTabsHandler())->Attach(this)); 396 AddMessageHandler((new RecentlyClosedTabsHandler())->Attach(this));
396 AddMessageHandler((new MetricsHandler())->Attach(this)); 397 AddMessageHandler((new MetricsHandler())->Attach(this));
397 if (GetProfile()->IsSyncAccessible()) 398 if (GetProfile()->IsSyncAccessible())
398 AddMessageHandler((new NewTabPageSyncHandler())->Attach(this)); 399 AddMessageHandler((new NewTabPageSyncHandler())->Attach(this));
399 ExtensionService* service = GetProfile()->GetExtensionService(); 400 ExtensionService* service = GetProfile()->GetExtensionService();
400 // We might not have an ExtensionService (on ChromeOS when not logged in 401 // We might not have an ExtensionService (on ChromeOS when not logged in
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 SendResponse(request_id, html_bytes); 684 SendResponse(request_id, html_bytes);
684 } 685 }
685 686
686 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { 687 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const {
687 return "text/html"; 688 return "text/html";
688 } 689 }
689 690
690 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { 691 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const {
691 return false; 692 return false;
692 } 693 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698