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 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1544 if (WebResourcesEnabled()) | 1544 if (WebResourcesEnabled()) |
1545 AddMessageHandler((new TipsHandler())->Attach(this)); | 1545 AddMessageHandler((new TipsHandler())->Attach(this)); |
1546 | 1546 |
1547 if (UseOldNewTabPage()) { | 1547 if (UseOldNewTabPage()) { |
1548 AddMessageHandler((new TemplateURLHandler())->Attach(this)); | 1548 AddMessageHandler((new TemplateURLHandler())->Attach(this)); |
1549 AddMessageHandler((new RecentlyBookmarkedHandler())->Attach(this)); | 1549 AddMessageHandler((new RecentlyBookmarkedHandler())->Attach(this)); |
1550 AddMessageHandler((new HistoryHandler())->Attach(this)); | 1550 AddMessageHandler((new HistoryHandler())->Attach(this)); |
1551 } | 1551 } |
1552 | 1552 |
1553 #ifdef CHROME_PERSONALIZATION | 1553 #ifdef CHROME_PERSONALIZATION |
1554 if (!Personalization::IsP13NDisabled(GetProfile())) { | 1554 if (Personalization::IsSyncEnabled(GetProfile())) { |
1555 AddMessageHandler(Personalization::CreateNewTabPageHandler(this)); | 1555 AddMessageHandler(Personalization::CreateNewTabPageHandler(this)); |
1556 } | 1556 } |
1557 #endif | 1557 #endif |
1558 | 1558 |
1559 // In testing mode there may not be an I/O thread. | 1559 // In testing mode there may not be an I/O thread. |
1560 if (g_browser_process->io_thread()) { | 1560 if (g_browser_process->io_thread()) { |
1561 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, | 1561 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, |
1562 NewRunnableMethod(&chrome_url_data_manager, | 1562 NewRunnableMethod(&chrome_url_data_manager, |
1563 &ChromeURLDataManager::AddDataSource, | 1563 &ChromeURLDataManager::AddDataSource, |
1564 new DOMUIThemeSource(GetProfile()))); | 1564 new DOMUIThemeSource(GetProfile()))); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1613 bool NewTabUI::WebResourcesEnabled() { | 1613 bool NewTabUI::WebResourcesEnabled() { |
1614 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1614 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
1615 return command_line->HasSwitch(switches::kEnableWebResources); | 1615 return command_line->HasSwitch(switches::kEnableWebResources); |
1616 } | 1616 } |
1617 | 1617 |
1618 // static | 1618 // static |
1619 bool NewTabUI::FirstRunDisabled() { | 1619 bool NewTabUI::FirstRunDisabled() { |
1620 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1620 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
1621 return command_line->HasSwitch(switches::kDisableNewTabFirstRun); | 1621 return command_line->HasSwitch(switches::kDisableNewTabFirstRun); |
1622 } | 1622 } |
OLD | NEW |