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

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

Issue 8689013: Remove TOUCH_UI specific new tab page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with trunk Created 9 years, 1 month 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 b3a8dc8b5bf49872ec2b062a1e31725dec1de2e2..cd1e9f309cc802fd106b34e552a48f702977c140 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -97,10 +97,8 @@ NewTabUI::NewTabUI(TabContents* contents)
AddMessageHandler((new AppLauncherHandler(service))->Attach(this));
AddMessageHandler((new NewTabPageHandler())->Attach(this));
- if (NTP4Enabled()) {
- AddMessageHandler((new BookmarksHandler())->Attach(this));
- AddMessageHandler((new FaviconWebUIHandler())->Attach(this));
- }
+ AddMessageHandler((new BookmarksHandler())->Attach(this));
+ AddMessageHandler((new FaviconWebUIHandler())->Attach(this));
}
if (NTPLoginHandler::ShouldShow(GetProfile()))
@@ -119,9 +117,6 @@ NewTabUI::NewTabUI(TabContents* contents)
registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
content::Source<ThemeService>(
ThemeServiceFactory::GetForProfile(GetProfile())));
- // Listen for bookmark bar visibility changes.
- pref_change_registrar_.Init(GetProfile()->GetPrefs());
- pref_change_registrar_.Add(prefs::kShowBookmarkBar, this);
}
NewTabUI::~NewTabUI() {
@@ -192,21 +187,6 @@ void NewTabUI::Observe(int type,
CallJavascriptFunction("themeChanged", args);
break;
}
- case chrome::NOTIFICATION_PREF_CHANGED: {
- const std::string& pref_name =
- *content::Details<std::string>(details).ptr();
- if (pref_name == prefs::kShowBookmarkBar) {
- if (!NTP4Enabled() && CanShowBookmarkBar()) {
- if (GetProfile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar))
- CallJavascriptFunction("bookmarkBarAttached");
- else
- CallJavascriptFunction("bookmarkBarDetached");
Evan Stade 2011/11/30 03:42:20 technically, I think we may need this all for ntp4
Rick Byers 2011/11/30 14:29:34 Ah, ok. Sounds pretty low priority, so I'll commi
- }
- } else {
- NOTREACHED();
- }
- break;
- }
case content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT: {
last_paint_ = base::TimeTicks::Now();
break;
@@ -227,8 +207,7 @@ void NewTabUI::RegisterUserPrefs(PrefService* prefs) {
NewTabPageHandler::RegisterUserPrefs(prefs);
AppLauncherHandler::RegisterUserPrefs(prefs);
MostVisitedHandler::RegisterUserPrefs(prefs);
- if (NTP4Enabled())
- BookmarksHandler::RegisterUserPrefs(prefs);
+ BookmarksHandler::RegisterUserPrefs(prefs);
}
// static
@@ -268,18 +247,9 @@ void NewTabUI::SetURLTitleAndDirection(DictionaryValue* dictionary,
}
// static
-bool NewTabUI::NTP4Enabled() {
-#if defined(TOUCH_UI)
- return CommandLine::ForCurrentProcess()->HasSwitch(switches::kNewTabPage);
-#else
- return true;
-#endif
-}
-
-// static
bool NewTabUI::NTP4BookmarkFeaturesEnabled() {
CommandLine* cl = CommandLine::ForCurrentProcess();
- return NTP4Enabled() && cl->HasSwitch(switches::kEnableNTPBookmarkFeatures);
+ return cl->HasSwitch(switches::kEnableNTPBookmarkFeatures);
}
///////////////////////////////////////////////////////////////////////////////
« 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