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

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

Issue 256763004: Remove WebUI NTP on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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/android/promo_handler.cc ('k') | chrome/chrome_browser_ui.gypi » ('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 aab5d1d83b7c8363610a4d2ded360df99950c96d..ec3a3ffc08a87315e4c79230d7663d7fe762b675 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -15,13 +15,19 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/metrics_handler.h"
+#include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
+#include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h"
#include "chrome/browser/ui/webui/ntp/favicon_webui_handler.h"
#include "chrome/browser/ui/webui/ntp/foreign_session_handler.h"
#include "chrome/browser/ui/webui/ntp/most_visited_handler.h"
+#include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h"
+#include "chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h"
+#include "chrome/browser/ui/webui/ntp/ntp_login_handler.h"
#include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h"
#include "chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h"
#include "chrome/browser/ui/webui/ntp/ntp_user_data_logger.h"
#include "chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.h"
+#include "chrome/browser/ui/webui/ntp/suggestions_page_handler.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "components/user_prefs/pref_registry_syncable.h"
@@ -36,21 +42,6 @@
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#if !defined(OS_ANDROID)
-#include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
-#include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h"
-#include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h"
-#include "chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h"
-#include "chrome/browser/ui/webui/ntp/ntp_login_handler.h"
-#include "chrome/browser/ui/webui/ntp/suggestions_page_handler.h"
-#else
-#include "chrome/browser/ui/webui/ntp/android/bookmarks_handler.h"
-#include "chrome/browser/ui/webui/ntp/android/context_menu_handler.h"
-#include "chrome/browser/ui/webui/ntp/android/navigation_handler.h"
-#include "chrome/browser/ui/webui/ntp/android/new_tab_page_ready_handler.h"
-#include "chrome/browser/ui/webui/ntp/android/promo_handler.h"
-#endif
-
#if defined(ENABLE_THEMES)
#include "chrome/browser/ui/webui/theme_handler.h"
#endif
@@ -105,7 +96,6 @@ NewTabUI::NewTabUI(content::WebUI* web_ui)
web_ui->AddMessageHandler(new MetricsHandler());
web_ui->AddMessageHandler(new MostVisitedHandler());
web_ui->AddMessageHandler(new RecentlyClosedTabsHandler());
-#if !defined(OS_ANDROID)
web_ui->AddMessageHandler(new FaviconWebUIHandler());
web_ui->AddMessageHandler(new NewTabPageHandler());
web_ui->AddMessageHandler(new CoreAppLauncherHandler());
@@ -114,30 +104,15 @@ NewTabUI::NewTabUI(content::WebUI* web_ui)
// Android doesn't have a sync promo/username on NTP.
web_ui->AddMessageHandler(new NewTabPageSyncHandler());
- if (MightShowApps()) {
- ExtensionService* service = GetProfile()->GetExtensionService();
- // We might not have an ExtensionService (on ChromeOS when not logged in
- // for example).
- if (service)
- web_ui->AddMessageHandler(new AppLauncherHandler(service));
- }
-#endif
+ ExtensionService* service = GetProfile()->GetExtensionService();
+ // We might not have an ExtensionService (on ChromeOS when not logged in
+ // for example).
+ if (service)
+ web_ui->AddMessageHandler(new AppLauncherHandler(service));
}
-#if defined(OS_ANDROID)
- // These handlers are specific to the Android NTP page.
- web_ui->AddMessageHandler(new BookmarksHandler());
- web_ui->AddMessageHandler(new ContextMenuHandler());
- web_ui->AddMessageHandler(new FaviconWebUIHandler());
- web_ui->AddMessageHandler(new NavigationHandler());
- web_ui->AddMessageHandler(new NewTabPageReadyHandler());
- if (!GetProfile()->IsOffTheRecord())
- web_ui->AddMessageHandler(new PromoHandler());
-#else
- // Android uses native UI for sync setup.
if (NTPLoginHandler::ShouldShow(GetProfile()))
web_ui->AddMessageHandler(new NTPLoginHandler());
-#endif
#if defined(ENABLE_THEMES)
// The theme handler can require some CPU, so do it after hooking up the most
@@ -247,33 +222,23 @@ void NewTabUI::OnShowBookmarkBarChanged() {
// static
void NewTabUI::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
-#if !defined(OS_ANDROID)
CoreAppLauncherHandler::RegisterProfilePrefs(registry);
NewTabPageHandler::RegisterProfilePrefs(registry);
if (NewTabUI::IsDiscoveryInNTPEnabled())
SuggestionsHandler::RegisterProfilePrefs(registry);
-#endif
MostVisitedHandler::RegisterProfilePrefs(registry);
browser_sync::ForeignSessionHandler::RegisterProfilePrefs(registry);
}
// static
bool NewTabUI::MightShowApps() {
Ted C 2014/04/25 19:50:58 I think you can remove this method entirely now
aurimas (slooooooooow) 2014/04/25 20:10:48 Done.
-// Android does not have apps.
-#if defined(OS_ANDROID)
- return false;
-#else
return true;
-#endif
}
// static
bool NewTabUI::ShouldShowApps() {
// Ash shows apps in app list thus should not show apps page in NTP4.
-// Android does not have apps.
-#if defined(OS_ANDROID)
- return false;
-#elif defined(USE_ASH)
+#if defined(USE_ASH)
return chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_ASH;
#else
return true;
@@ -372,14 +337,6 @@ void NewTabUI::NewTabHTMLSource::StartDataRequest(
if (!path.empty() && path[0] != '#') {
// A path under new-tab was requested; it's likely a bad relative
// URL from the new tab page, but in any case it's an error.
-
- // TODO(dtrainor): Can remove this #if check once we update the
- // accessibility script to no longer try to access urls like
- // '?2314124523523'.
- // See http://crbug.com/150252.
-#if !defined(OS_ANDROID)
- NOTREACHED() << path << " should not have been requested on the NTP";
-#endif
callback.Run(NULL);
return;
}
« no previous file with comments | « chrome/browser/ui/webui/ntp/android/promo_handler.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698