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

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

Issue 9358031: Added new adaptive "Suggest" tab on the New Tab Page, behing the flag, for the experiments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove extra line Created 8 years, 10 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
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 452880e466effaae6130ca813f0ec904e92ef655..7622d06c3b5520cf96fc76b19783d3a2642c6a3a 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -38,6 +38,7 @@
#include "chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h"
#include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h"
#include "chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.h"
+#include "chrome/browser/ui/webui/ntp/suggested_page_handler.h"
#include "chrome/browser/ui/webui/theme_source.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
@@ -99,6 +100,7 @@ NewTabUI::NewTabUI(content::WebUI* web_ui)
if (!GetProfile()->IsOffTheRecord()) {
web_ui->AddMessageHandler(new browser_sync::ForeignSessionHandler());
web_ui->AddMessageHandler(new MostVisitedHandler());
+ web_ui->AddMessageHandler(new SuggestedHandler());
web_ui->AddMessageHandler(new RecentlyClosedTabsHandler());
web_ui->AddMessageHandler(new MetricsHandler());
if (GetProfile()->IsSyncAccessible())
@@ -218,6 +220,7 @@ void NewTabUI::RegisterUserPrefs(PrefService* prefs) {
NewTabPageHandler::RegisterUserPrefs(prefs);
AppLauncherHandler::RegisterUserPrefs(prefs);
MostVisitedHandler::RegisterUserPrefs(prefs);
+ SuggestedHandler::RegisterUserPrefs(prefs);
}
// static
@@ -248,6 +251,14 @@ bool NewTabUI::IsWebStoreExperimentEnabled() {
}
// static
+bool NewTabUI::IsSuggestedPageEnabled() {
+ const CommandLine* cli = CommandLine::ForCurrentProcess();
+ if (cli->HasSwitch(switches::kEnableSuggestedTabPage))
+ return true;
+ return false;
Dan Beam 2012/02/09 01:43:06 why not return CommandLine::ForCurrentProcess()-
GeorgeY 2012/02/10 00:00:36 sure
+}
+
+// static
void NewTabUI::SetURLTitleAndDirection(DictionaryValue* dictionary,
const string16& title,
const GURL& gurl) {

Powered by Google App Engine
This is Rietveld 408576698