| Index: chrome/browser/chrome_content_browser_client.cc
|
| diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
|
| index b8ee4de63eb65f7835a38e32825d65732622c8cb..5660e22e33c06e1a74443f9dd1cb6165df0ea80d 100644
|
| --- a/chrome/browser/chrome_content_browser_client.cc
|
| +++ b/chrome/browser/chrome_content_browser_client.cc
|
| @@ -532,6 +532,17 @@ bool HandleNewTabPageLocationOverride(
|
|
|
| // Handles rewriting Web UI URLs.
|
| bool HandleWebUI(GURL* url, content::BrowserContext* browser_context) {
|
| + if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings)) {
|
| + // Rewrite chrome://help and chrome://chrome to chrome://settings/help.
|
| + if (url->host() == chrome::kChromeUIHelpHost ||
|
| + (url->host() == chrome::kChromeUIUberHost &&
|
| + (url->path().empty() || url->path() == "/"))) {
|
| + *url = ReplaceURLHostAndPath(*url, chrome::kChromeUISettingsHost,
|
| + chrome::kChromeUIHelpHost);
|
| + return true; // Return true to update the displayed URL.
|
| + }
|
| + }
|
| +
|
| // Do not handle special URLs such as "about:foo"
|
| if (!url->host().empty()) {
|
| const GURL chrome_url = AddUberHost(*url);
|
| @@ -567,6 +578,13 @@ bool HandleWebUI(GURL* url, content::BrowserContext* browser_context) {
|
| // Reverse URL handler for Web UI. Maps "chrome://chrome/foo/" to
|
| // "chrome://foo/".
|
| bool HandleWebUIReverse(GURL* url, content::BrowserContext* browser_context) {
|
| + // No need to actually reverse-rewrite the URL, but return true to update the
|
| + // displayed URL when rewriting chrome://help to chrome://settings/help.
|
| + if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings) &&
|
| + url->host() == chrome::kChromeUISettingsHost) {
|
| + return true;
|
| + }
|
| +
|
| if (!url->is_valid() || !url->SchemeIs(content::kChromeUIScheme))
|
| return false;
|
|
|
|
|