OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/android/ntp/new_tab_page_url_handler.h" | 5 #include "chrome/browser/android/ntp/new_tab_page_url_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "chrome/browser/android/chrome_feature_list.h" | 10 #include "chrome/browser/android/chrome_feature_list.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 // when M39 is a distant memory. http://crbug.com/455427 | 28 // when M39 is a distant memory. http://crbug.com/455427 |
29 if (url->host() == chrome::kChromeUINewTabHost || | 29 if (url->host() == chrome::kChromeUINewTabHost || |
30 url->host() == kLegacyWelcomeHost) { | 30 url->host() == kLegacyWelcomeHost) { |
31 *url = GURL(chrome::kChromeUINativeNewTabURL); | 31 *url = GURL(chrome::kChromeUINativeNewTabURL); |
32 return true; | 32 return true; |
33 } | 33 } |
34 | 34 |
35 // TODO(twellington): stop redirecting chrome://history to | 35 // TODO(twellington): stop redirecting chrome://history to |
36 // chrome-native://history when M57 is a distant memory. | 36 // chrome-native://history when M57 is a distant memory. |
37 // See http://crbug.com/654071. | 37 // See http://crbug.com/654071. |
38 if (base::FeatureList::IsEnabled(features::kNativeAndroidHistoryManager) && | 38 if (url->host() == kChromeUIHistoryHost) { |
39 (url->host() == kChromeUIHistoryHost || | |
40 url->host() == kChromeUIHistoryFrameHost)) { | |
41 *url = GURL(kChromeUINativeHistoryURL); | 39 *url = GURL(kChromeUINativeHistoryURL); |
42 return true; | 40 return true; |
43 } | 41 } |
44 | 42 |
45 if (url->host() == kChromeUIPhysicalWebDiagnosticsHost) { | 43 if (url->host() == kChromeUIPhysicalWebDiagnosticsHost) { |
46 *url = GURL(kChromeUINativePhysicalWebDiagnosticsURL); | 44 *url = GURL(kChromeUINativePhysicalWebDiagnosticsURL); |
47 return true; | 45 return true; |
48 } | 46 } |
49 } | 47 } |
50 | 48 |
51 if (url->SchemeIs(chrome::kChromeNativeScheme) && | 49 if (url->SchemeIs(chrome::kChromeNativeScheme) && |
52 url->host() == kChromeUIBookmarksHost) { | 50 url->host() == kChromeUIBookmarksHost) { |
53 std::string ref = url->ref(); | 51 std::string ref = url->ref(); |
54 if (!ref.empty()) { | 52 if (!ref.empty()) { |
55 *url = GURL(std::string(kChromeUINativeBookmarksURL) | 53 *url = GURL(std::string(kChromeUINativeBookmarksURL) |
56 .append(kBookmarkFolderPath) | 54 .append(kBookmarkFolderPath) |
57 .append(ref)); | 55 .append(ref)); |
58 return true; | 56 return true; |
59 } | 57 } |
60 } | 58 } |
61 | 59 |
62 return false; | 60 return false; |
63 } | 61 } |
64 | 62 |
65 } // namespace android | 63 } // namespace android |
66 } // namespace chrome | 64 } // namespace chrome |
OLD | NEW |