Commit 4bdfb4b6 authored by newt's avatar newt Committed by Commit bot

Redirect chrome://welcome to the new tab page.

The welcome page was removed in M40. Users who had the welcome page open
when upgrading from pre-M40 to post-M40 will see a "webpage not
available" error after the upgrade. This fixes that behavior by
replacing the welcome page with an NTP.

BUG=455427

Review URL: https://codereview.chromium.org/1036533002

Cr-Commit-Position: refs/heads/master@{#322049}
parent 703acf7c
......@@ -13,6 +13,7 @@
namespace {
const char kBookmarkFolderPath[] = "folder/";
const char kLegacyWelcomeHost[] = "welcome";
}
namespace chrome {
......@@ -20,10 +21,14 @@ namespace android {
bool HandleAndroidNativePageURL(GURL* url,
content::BrowserContext* browser_context) {
if (url->SchemeIs(content::kChromeUIScheme) &&
url->host() == chrome::kChromeUINewTabHost) {
*url = GURL(chrome::kChromeUINativeNewTabURL);
return true;
if (url->SchemeIs(content::kChromeUIScheme)) {
// TODO(newt): stop redirecting chrome://welcome to chrome-native://newtab
// when M39 is a distant memory. http://crbug.com/455427
if (url->host() == chrome::kChromeUINewTabHost ||
url->host() == kLegacyWelcomeHost) {
*url = GURL(chrome::kChromeUINativeNewTabURL);
return true;
}
}
if (url->SchemeIs(chrome::kChromeNativeScheme) &&
......
......@@ -255,10 +255,6 @@ extern const char kChromeUIThemePath[];
extern const char kChromeUIPrintHost[];
#endif // ENABLE_PRINT_PREVIEW
#if defined(OS_ANDROID)
extern const char kChromeUIWelcomeHost[];
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
extern const char kChromeUILinuxProxyConfigHost[];
extern const char kChromeUISandboxHost[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment