MD Settings: If on a file:// URL, don't navigate to Site Details via Page Info.
PermissionManager doesn't seem to support retrieving permission settings for
file:// scheme URLs, which means Site Details won't either. Temporarily disable
navigation to Site Details from a file:// URL until https://crbug.com/444047 can
be fixed.
Bug: 656758, 444047, 762751
Change-Id: Ib12f0990e22e26e20706e976a6cb21c6def70c7d
Reviewed-on: https://chromium-review.googlesource.com/647355
Commit-Queue: Patti <[email protected]>
Reviewed-by: Raymes Khoury <[email protected]>
Cr-Commit-Position: refs/heads/master@{#500188}
diff --git a/chrome/browser/ui/page_info/page_info.cc b/chrome/browser/ui/page_info/page_info.cc
index 818288d6..e0e59f3 100644
--- a/chrome/browser/ui/page_info/page_info.cc
+++ b/chrome/browser/ui/page_info/page_info.cc
@@ -448,10 +448,14 @@
// settings page specific to the current origin of the page. crbug.com/655876
url::Origin site_origin = url::Origin(site_url());
std::string link_destination(chrome::kChromeUIContentSettingsURL);
+ // TODO(https://crbug.com/444047): Site Details should work with file:// urls
+ // when this bug is fixed, so add it to the whitelist when that happens.
if ((base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableSiteSettings) ||
base::FeatureList::IsEnabled(features::kSiteDetails)) &&
- !site_origin.unique()) {
+ !site_origin.unique() &&
+ (site_url().SchemeIsHTTPOrHTTPS() ||
+ site_url().SchemeIs(content_settings::kExtensionScheme))) {
std::string origin_string = site_origin.Serialize();
url::RawCanonOutputT<char> percent_encoded_origin;
url::EncodeURIComponent(origin_string.c_str(), origin_string.length(),