Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2962603002: MD Settings: fix help/ redirection to only happen on chrome://help (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e90776dd85cb24093ca8470a701097d0c9d1c0ce..8b9f1638a78ce8b0fc049ff2ca189413e3a48a8c 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -645,9 +645,10 @@ bool HandleNewTabPageLocationOverride(
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() == "/"))) {
+ if (url->SchemeIs(content::kChromeUIScheme) &&
+ (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.
@@ -692,6 +693,7 @@ 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->SchemeIs(content::kChromeUIScheme) &&
url->host() == chrome::kChromeUISettingsHost) {
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698