OLD | NEW |
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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 if (NewTabUI::FirstRunDisabled()) | 206 if (NewTabUI::FirstRunDisabled()) |
207 NewTabHTMLSource::set_first_run(false); | 207 NewTabHTMLSource::set_first_run(false); |
208 | 208 |
209 static bool first_view = true; | 209 static bool first_view = true; |
210 if (first_view) { | 210 if (first_view) { |
211 first_view = false; | 211 first_view = false; |
212 } | 212 } |
213 | 213 |
214 if (!GetProfile()->IsOffTheRecord()) { | 214 if (!GetProfile()->IsOffTheRecord()) { |
215 PrefService* pref_service = GetProfile()->GetPrefs(); | 215 PrefService* pref_service = GetProfile()->GetPrefs(); |
216 AddMessageHandler((new NTPLoginHandler())->Attach(this)); | 216 if (!NewTabSyncSetupHandler::ShouldShowSyncPromo()) |
| 217 AddMessageHandler((new NTPLoginHandler())->Attach(this)); |
217 AddMessageHandler((new ShownSectionsHandler(pref_service))->Attach(this)); | 218 AddMessageHandler((new ShownSectionsHandler(pref_service))->Attach(this)); |
218 AddMessageHandler((new browser_sync::ForeignSessionHandler())-> | 219 AddMessageHandler((new browser_sync::ForeignSessionHandler())-> |
219 Attach(this)); | 220 Attach(this)); |
220 AddMessageHandler((new MostVisitedHandler())->Attach(this)); | 221 AddMessageHandler((new MostVisitedHandler())->Attach(this)); |
221 AddMessageHandler((new RecentlyClosedTabsHandler())->Attach(this)); | 222 AddMessageHandler((new RecentlyClosedTabsHandler())->Attach(this)); |
222 AddMessageHandler((new MetricsHandler())->Attach(this)); | 223 AddMessageHandler((new MetricsHandler())->Attach(this)); |
223 if (GetProfile()->IsSyncAccessible()) | 224 if (GetProfile()->IsSyncAccessible()) |
224 AddMessageHandler((new NewTabPageSyncHandler())->Attach(this)); | 225 AddMessageHandler((new NewTabPageSyncHandler())->Attach(this)); |
225 ExtensionService* service = GetProfile()->GetExtensionService(); | 226 ExtensionService* service = GetProfile()->GetExtensionService(); |
226 // We might not have an ExtensionService (on ChromeOS when not logged in | 227 // We might not have an ExtensionService (on ChromeOS when not logged in |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 SendResponse(request_id, html_bytes); | 459 SendResponse(request_id, html_bytes); |
459 } | 460 } |
460 | 461 |
461 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { | 462 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { |
462 return "text/html"; | 463 return "text/html"; |
463 } | 464 } |
464 | 465 |
465 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { | 466 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { |
466 return false; | 467 return false; |
467 } | 468 } |
OLD | NEW |