| 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 <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1491 // highly. Note this means we're including clicks on not only most visited | 1491 // highly. Note this means we're including clicks on not only most visited |
| 1492 // thumbnails, but also clicks on recently bookmarked. | 1492 // thumbnails, but also clicks on recently bookmarked. |
| 1493 link_transition_type_ = PageTransition::AUTO_BOOKMARK; | 1493 link_transition_type_ = PageTransition::AUTO_BOOKMARK; |
| 1494 | 1494 |
| 1495 if (NewTabHTMLSource::first_view() && | 1495 if (NewTabHTMLSource::first_view() && |
| 1496 (GetProfile()->GetPrefs()->GetInteger(prefs::kRestoreOnStartup) != 0 || | 1496 (GetProfile()->GetPrefs()->GetInteger(prefs::kRestoreOnStartup) != 0 || |
| 1497 !GetProfile()->GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage))) { | 1497 !GetProfile()->GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage))) { |
| 1498 NewTabHTMLSource::set_first_view(false); | 1498 NewTabHTMLSource::set_first_view(false); |
| 1499 } | 1499 } |
| 1500 | 1500 |
| 1501 if (NewTabUI::FirstRunDisabled()) |
| 1502 NewTabHTMLSource::set_first_run(false); |
| 1503 |
| 1501 tab_contents()->render_view_host()->set_paint_observer(new PaintTimer); | 1504 tab_contents()->render_view_host()->set_paint_observer(new PaintTimer); |
| 1502 | 1505 |
| 1503 if (GetProfile()->IsOffTheRecord()) { | 1506 if (GetProfile()->IsOffTheRecord()) { |
| 1504 incognito_ = true; | 1507 incognito_ = true; |
| 1505 | 1508 |
| 1506 IncognitoTabHTMLSource* html_source = new IncognitoTabHTMLSource(); | 1509 IncognitoTabHTMLSource* html_source = new IncognitoTabHTMLSource(); |
| 1507 | 1510 |
| 1508 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, | 1511 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, |
| 1509 NewRunnableMethod(&chrome_url_data_manager, | 1512 NewRunnableMethod(&chrome_url_data_manager, |
| 1510 &ChromeURLDataManager::AddDataSource, | 1513 &ChromeURLDataManager::AddDataSource, |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1592 bool NewTabUI::UseOldNewTabPage() { | 1595 bool NewTabUI::UseOldNewTabPage() { |
| 1593 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1596 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 1594 return command_line->HasSwitch(switches::kOldNewTabPage); | 1597 return command_line->HasSwitch(switches::kOldNewTabPage); |
| 1595 } | 1598 } |
| 1596 | 1599 |
| 1597 // static | 1600 // static |
| 1598 bool NewTabUI::WebResourcesEnabled() { | 1601 bool NewTabUI::WebResourcesEnabled() { |
| 1599 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1602 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 1600 return command_line->HasSwitch(switches::kEnableWebResources); | 1603 return command_line->HasSwitch(switches::kEnableWebResources); |
| 1601 } | 1604 } |
| 1605 |
| 1606 // static |
| 1607 bool NewTabUI::FirstRunDisabled() { |
| 1608 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 1609 return command_line->HasSwitch(switches::kDisableNewTabFirstRun); |
| 1610 } |
| OLD | NEW |