summaryrefslogtreecommitdiffstats
path: root/chrome/browser/android/new_tab_page_url_handler.h
blob: 90c968aaa79b10beebfa0a7f32f5d191e0660de4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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_