diff options
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r-- | chrome/browser/dom_ui/new_tab_ui.cc | 9 | ||||
-rw-r--r-- | chrome/browser/dom_ui/new_tab_ui.h | 6 |
2 files changed, 14 insertions, 1 deletions
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index deb9683..5ccd3fe 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -1498,6 +1498,9 @@ NewTabUI::NewTabUI(TabContents* contents) NewTabHTMLSource::set_first_view(false); } + if (NewTabUI::FirstRunDisabled()) + NewTabHTMLSource::set_first_run(false); + tab_contents()->render_view_host()->set_paint_observer(new PaintTimer); if (GetProfile()->IsOffTheRecord()) { @@ -1599,3 +1602,9 @@ bool NewTabUI::WebResourcesEnabled() { const CommandLine* command_line = CommandLine::ForCurrentProcess(); return command_line->HasSwitch(switches::kEnableWebResources); } + +// static +bool NewTabUI::FirstRunDisabled() { + const CommandLine* command_line = CommandLine::ForCurrentProcess(); + return command_line->HasSwitch(switches::kDisableNewTabFirstRun); +} diff --git a/chrome/browser/dom_ui/new_tab_ui.h b/chrome/browser/dom_ui/new_tab_ui.h index fde0fe2..07f27ca 100644 --- a/chrome/browser/dom_ui/new_tab_ui.h +++ b/chrome/browser/dom_ui/new_tab_ui.h @@ -31,7 +31,11 @@ class NewTabUI : public DOMUI, // Whether we should disable the web resources backend service static bool WebResourcesEnabled(); - private: + // Whether we should disable the first run notification based on the command + // line switch. + static bool FirstRunDisabled(); + +private: void Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details); |