| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/dom_ui/new_tab_ui.h" | 7 #include "chrome/browser/dom_ui/new_tab_ui.h" |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 &ChromeURLDataManager::AddDataSource, | 554 &ChromeURLDataManager::AddDataSource, |
| 555 html_source)); | 555 html_source)); |
| 556 } else { | 556 } else { |
| 557 AddMessageHandler((new ShownSectionsHandler())->Attach(this)); | 557 AddMessageHandler((new ShownSectionsHandler())->Attach(this)); |
| 558 AddMessageHandler((new MostVisitedHandler())->Attach(this)); | 558 AddMessageHandler((new MostVisitedHandler())->Attach(this)); |
| 559 AddMessageHandler((new RecentlyClosedTabsHandler())->Attach(this)); | 559 AddMessageHandler((new RecentlyClosedTabsHandler())->Attach(this)); |
| 560 AddMessageHandler((new MetricsHandler())->Attach(this)); | 560 AddMessageHandler((new MetricsHandler())->Attach(this)); |
| 561 if (WebResourcesEnabled()) | 561 if (WebResourcesEnabled()) |
| 562 AddMessageHandler((new TipsHandler())->Attach(this)); | 562 AddMessageHandler((new TipsHandler())->Attach(this)); |
| 563 | 563 |
| 564 #if defined(BROWSER_SYNC) && !defined(OS_POSIX) | 564 #if !defined(OS_POSIX) |
| 565 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableSync)) { | 565 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableSync)) { |
| 566 AddMessageHandler((new NewTabPageSyncHandler())->Attach(this)); | 566 AddMessageHandler((new NewTabPageSyncHandler())->Attach(this)); |
| 567 } | 567 } |
| 568 #endif | 568 #endif |
| 569 | 569 |
| 570 AddMessageHandler((new NewTabPageSetHomepageHandler())->Attach(this)); | 570 AddMessageHandler((new NewTabPageSetHomepageHandler())->Attach(this)); |
| 571 | 571 |
| 572 // In testing mode there may not be an I/O thread. | 572 // In testing mode there may not be an I/O thread. |
| 573 if (g_browser_process->io_thread()) { | 573 if (g_browser_process->io_thread()) { |
| 574 InitializeCSSCaches(); | 574 InitializeCSSCaches(); |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 std::string json_html; | 906 std::string json_html; |
| 907 jstemplate_builder::AppendJsonHtml(&localized_strings, &json_html); | 907 jstemplate_builder::AppendJsonHtml(&localized_strings, &json_html); |
| 908 | 908 |
| 909 static const std::string template_data_placeholder = | 909 static const std::string template_data_placeholder = |
| 910 "<!-- template data placeholder -->"; | 910 "<!-- template data placeholder -->"; |
| 911 ReplaceFirstSubstringAfterOffset(&full_html_, 0, template_data_placeholder, | 911 ReplaceFirstSubstringAfterOffset(&full_html_, 0, template_data_placeholder, |
| 912 json_html); | 912 json_html); |
| 913 | 913 |
| 914 jstemplate_builder::AppendI18nTemplateProcessHtml(&full_html_); | 914 jstemplate_builder::AppendI18nTemplateProcessHtml(&full_html_); |
| 915 } | 915 } |
| OLD | NEW |