Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5728)

Unified Diff: chrome/browser/ui/webui/ntp/new_tab_ui.cc

Issue 7600013: ntp4: make default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit test failures Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_ui.h ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/new_tab_ui.cc
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
index 4af26deaf1868dddb7fb6fd8911d83540f4ffa0c..2bc8a3174d60276991565ef9897bf6523da35347 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -189,7 +189,7 @@ NewTabUI::NewTabUI(TabContents* contents)
// Override some options on the Web UI.
hide_favicon_ = true;
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewTabPage4) &&
+ if (Ntp4Enabled() &&
GetProfile()->GetPrefs()->GetBoolean(prefs::kEnableBookmarkBar) &&
browser_defaults::bookmarks_enabled) {
set_force_bookmark_bar_visible(true);
@@ -223,7 +223,7 @@ NewTabUI::NewTabUI(TabContents* contents)
AddMessageHandler((new AppLauncherHandler(service))->Attach(this));
AddMessageHandler((new NewTabPageHandler())->Attach(this));
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewTabPage4)) {
+ if (Ntp4Enabled()) {
AddMessageHandler((new BookmarksHandler())->Attach(this));
AddMessageHandler((new FaviconWebUIHandler())->Attach(this));
}
@@ -418,6 +418,15 @@ void NewTabUI::SetURLTitleAndDirection(DictionaryValue* dictionary,
dictionary->SetString("direction", direction);
}
+// static
+bool NewTabUI::Ntp4Enabled() {
+#if defined(TOUCH_UI)
+ return CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewTabPage);
+#else
+ return !CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewTabPage);
+#endif
+}
+
///////////////////////////////////////////////////////////////////////////////
// NewTabHTMLSource
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_ui.h ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698