OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/histogram.h" | 9 #include "base/histogram.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 AddMessageHandler(new RecentlyBookmarkedHandler(this)); | 1046 AddMessageHandler(new RecentlyBookmarkedHandler(this)); |
1047 AddMessageHandler(new RecentlyClosedTabsHandler(this)); | 1047 AddMessageHandler(new RecentlyClosedTabsHandler(this)); |
1048 AddMessageHandler(new HistoryHandler(this)); | 1048 AddMessageHandler(new HistoryHandler(this)); |
1049 AddMessageHandler(new MetricsHandler(this)); | 1049 AddMessageHandler(new MetricsHandler(this)); |
1050 #ifdef CHROME_PERSONALIZATION | 1050 #ifdef CHROME_PERSONALIZATION |
1051 if (!Personalization::IsP13NDisabled()) { | 1051 if (!Personalization::IsP13NDisabled()) { |
1052 AddMessageHandler(Personalization::CreateNewTabPageHandler(this)); | 1052 AddMessageHandler(Personalization::CreateNewTabPageHandler(this)); |
1053 } | 1053 } |
1054 #endif | 1054 #endif |
1055 | 1055 |
1056 NewTabHTMLSource* html_source = new NewTabHTMLSource(); | |
1057 | |
1058 // In testing mode there may not be an I/O thread. | 1056 // In testing mode there may not be an I/O thread. |
1059 if (g_browser_process->io_thread()) { | 1057 if (g_browser_process->io_thread()) { |
| 1058 NewTabHTMLSource* html_source = new NewTabHTMLSource(); |
1060 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, | 1059 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, |
1061 NewRunnableMethod(&chrome_url_data_manager, | 1060 NewRunnableMethod(&chrome_url_data_manager, |
1062 &ChromeURLDataManager::AddDataSource, | 1061 &ChromeURLDataManager::AddDataSource, |
1063 html_source)); | 1062 html_source)); |
1064 } | 1063 } |
1065 } | 1064 } |
1066 } | 1065 } |
1067 | 1066 |
1068 NewTabUI::~NewTabUI() { | 1067 NewTabUI::~NewTabUI() { |
1069 } | 1068 } |
1070 | 1069 |
OLD | NEW |