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

Unified Diff: chrome/browser/android/new_tab_page_url_handler.h

Issue 205983005: [Android] Rewrite old-style NTP URLs to new-style URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/android/new_tab_page_url_handler.h
diff --git a/chrome/browser/android/new_tab_page_url_handler.h b/chrome/browser/android/new_tab_page_url_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..90c968aaa79b10beebfa0a7f32f5d191e0660de4
--- /dev/null
+++ b/chrome/browser/android/new_tab_page_url_handler.h
@@ -0,0 +1,34 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_NEW_TAB_PAGE_URL_HANDLER_H_
+#define CHROME_BROWSER_ANDROID_NEW_TAB_PAGE_URL_HANDLER_H_
+
+class GURL;
+
+namespace content {
+class BrowserContext;
+}
+
+namespace chrome {
+namespace android {
+
+// Rewrites old-style Android NTP URLs to new-style NTP URLs:
+// - chrome://newtab -> chrome-native://newtab
+// - chrome://newtab#most_visited -> chrome-native://newtab
+// - chrome://newtab#incognito -> chrome-native://newtab
+// - chrome://newtab#bookmarks -> chrome-native://bookmarks
+// - chrome://newtab#bookmarks:99 -> chrome-native://bookmarks
+// - chrome://newtab#open_tabs -> chrome-native://recent-tabs
+// - chrome-native://recent_tabs -> chrome-native://recent-tabs
+//
+// TODO(newt): Once most users have upgraded past M34, simplify this down to a
+// single rule: chrome://newtab -> chrome-native://newtab
+bool HandleAndroidNewTabURL(GURL* url,
+ content::BrowserContext* browser_context);
+
+} // namespace android
+} // namespace chrome
+
+#endif // CHROME_BROWSER_ANDROID_NEW_TAB_PAGE_URL_HANDLER_H_
« no previous file with comments | « no previous file | chrome/browser/android/new_tab_page_url_handler.cc » ('j') | chrome/browser/android/new_tab_page_url_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698