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 2ad0c41aa41c1ead7242ab332aea7337c67fbfe6..7fdea01863185eafea4e34542a71584c2e350a95 100644 |
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
@@ -193,12 +193,6 @@ NewTabUI::NewTabUI(TabContents* contents) |
// Override some options on the Web UI. |
hide_favicon_ = true; |
- if (!NTP4Enabled() && |
- GetProfile()->GetPrefs()->GetBoolean(prefs::kEnableBookmarkBar) && |
- browser_defaults::bookmarks_enabled) { |
- set_force_bookmark_bar_visible(true); |
- } |
- |
focus_location_bar_by_default_ = true; |
should_hide_url_ = true; |
overridden_title_ = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE); |
@@ -227,10 +221,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)); |
} |
// Add the sync setup handler for the sync promo UI. |
@@ -250,10 +242,6 @@ NewTabUI::NewTabUI(TabContents* contents) |
registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
Source<ThemeService>( |
ThemeServiceFactory::GetForProfile(GetProfile()))); |
- // Listen for bookmark bar visibility changes. |
- registrar_.Add(this, |
- chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, |
- NotificationService::AllSources()); |
} |
NewTabUI::~NewTabUI() { |
@@ -314,19 +302,6 @@ void NewTabUI::Observe(int type, |
CallJavascriptFunction("themeChanged", args); |
break; |
} |
- case chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED: { |
- if (GetProfile()->GetPrefs()->IsManagedPreference( |
- prefs::kEnableBookmarkBar)) { |
- break; |
- } |
- if (!NTP4Enabled()) { |
- if (GetProfile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar)) |
- CallJavascriptFunction("bookmarkBarAttached"); |
- else |
- CallJavascriptFunction("bookmarkBarDetached"); |
- } |
- break; |
- } |
case content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT: { |
last_paint_ = base::TimeTicks::Now(); |
break; |
@@ -352,8 +327,7 @@ void NewTabUI::RegisterUserPrefs(PrefService* prefs) { |
AppLauncherHandler::RegisterUserPrefs(prefs); |
MostVisitedHandler::RegisterUserPrefs(prefs); |
ShownSectionsHandler::RegisterUserPrefs(prefs); |
- if (NTP4Enabled()) |
- BookmarksHandler::RegisterUserPrefs(prefs); |
+ BookmarksHandler::RegisterUserPrefs(prefs); |
UpdateUserPrefsVersion(prefs); |
} |
@@ -426,15 +400,6 @@ 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 |