diff options
author | creis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-06 00:45:18 +0000 |
---|---|---|
committer | creis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-06 00:45:18 +0000 |
commit | 0d220839eeeb94724f785b7c030c80e2b9e2cc4b (patch) | |
tree | 6ca17c31714243193b6ea862d4408e303d8cc477 /chrome/browser/browser_url_handler.cc | |
parent | def1171cbb6c8857fd528736eb20dad5a3b50ecb (diff) | |
download | chromium_src-0d220839eeeb94724f785b7c030c80e2b9e2cc4b.zip chromium_src-0d220839eeeb94724f785b7c030c80e2b9e2cc4b.tar.gz chromium_src-0d220839eeeb94724f785b7c030c80e2b9e2cc4b.tar.bz2 |
Fixes navigations chrome-internal: to actually show the NTP.
We now rewrite chrome-internal: (the old NTP URL) to chrome://newtab. Before, we were not properly showing the NTP for this URL, which caused some problems with further navigations (particularly form submissions) from that tab.
Also, the default kHomePage string is now chrome://newtab instead of the outdated chrome-internal:. The logic in GeneralPageView is already designed to not show this URL in the preferences dialog.
BUG=6564
TEST=NewTabUITest.ChromeInternalLoadsNTP
Review URL: http://codereview.chromium.org/363019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31182 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_url_handler.cc')
-rw-r--r-- | chrome/browser/browser_url_handler.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/browser_url_handler.cc b/chrome/browser/browser_url_handler.cc index 17f6fda..a8a96e2 100644 --- a/chrome/browser/browser_url_handler.cc +++ b/chrome/browser/browser_url_handler.cc @@ -43,10 +43,20 @@ static bool HandleViewSource(GURL* url, Profile* profile) { return false; } -// Handles URLs for DOM UI. These URLs need no rewriting. +// Handles rewriting DOM UI URLs. static bool HandleDOMUI(GURL* url, Profile* profile) { if (!DOMUIFactory::UseDOMUIForURL(*url)) return false; + + // Special case the new tab page. In older versions of Chrome, the new tab + // page was hosted at chrome-internal:<blah>. This might be in people's saved + // sessions or bookmarks, so we say any URL with that scheme triggers the new + // tab page. + if (url->SchemeIs(chrome::kChromeInternalScheme)) { + // Rewrite it with the proper new tab URL. + *url = GURL(chrome::kChromeUINewTabURL); + } + return true; } |