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

Side by Side Diff: chrome/browser/android/new_tab_page_url_handler.cc

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/android/new_tab_page_url_handler.h"
6
7 #include <string>
8
9 #include "base/strings/string_util.h"
10 #include "chrome/common/url_constants.h"
11 #include "content/public/common/url_constants.h"
12 #include "url/gurl.h"
13
14 namespace chrome {
15 namespace android {
16
17 // static
samarth 2014/03/21 22:32:09 It's not really "static". I'd just leave this out
newt (away) 2014/03/26 17:47:25 Done.
18 bool HandleAndroidNewTabURL(GURL* url,
19 content::BrowserContext* browser_context) {
20 if (url->SchemeIs(content::kChromeUIScheme) &&
21 url->host() == chrome::kChromeUINewTabHost) {
22 std::string ref = url->ref();
23 if (StartsWithASCII(ref, "bookmarks", true)) {
jam 2014/03/21 19:47:26 nit: there are no constants for these already? i'
newt (away) 2014/03/26 17:47:25 These constants exist only in Java and JavaScript
24 *url = GURL(chrome::kChromeUINativeBookmarksURL);
25 } else if (ref == "open_tabs") {
26 *url = GURL(chrome::kChromeUINativeRecentTabsURL);
27 } else {
28 *url = GURL(chrome::kChromeUINativeNewTabURL);
29 }
30 return true;
31 }
32
33 if (url->SchemeIs(chrome::kChromeNativeScheme) &&
34 url->host() == "recent_tabs") {
35 *url = GURL(chrome::kChromeUINativeRecentTabsURL);
36 return true;
37 }
38
39 return false;
40 }
41
42 } // namespace android
43 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/android/new_tab_page_url_handler.h ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698