If a site contains mixed content or the https connection has an error then the Website Settings UI automatically selects the connection when it is opened.
BUG=143922
Review URL: https://chromiumcodereview.appspot.com/10829452
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154137 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/ui/website_settings/website_settings.cc b/chrome/browser/ui/website_settings/website_settings.cc
index d21a54c..da576162 100644
--- a/chrome/browser/ui/website_settings/website_settings.cc
+++ b/chrome/browser/ui/website_settings/website_settings.cc
@@ -417,6 +417,20 @@
IDS_PAGE_INFO_SECURITY_TAB_RENEGOTIATION_MESSAGE);
}
}
+
+ // By default select the permissions tab that displays all the site
+ // permissions. In case of a connection error or an issue with the
+ // certificate presented by the website, select the connection tab to draw
+ // the user's attention to the issue. If the site does not provide a
+ // certificate because it was loaded over an unencrypted connection, don't
+ // select the connection tab.
+ WebsiteSettingsUI::TabId tab_id = WebsiteSettingsUI::TAB_ID_PERMISSIONS;
+ if (site_connection_status_ == SITE_CONNECTION_STATUS_ENCRYPTED_ERROR ||
+ site_connection_status_ == SITE_CONNECTION_STATUS_MIXED_CONTENT ||
+ site_identity_status_ == SITE_IDENTITY_STATUS_ERROR ||
+ site_identity_status_ == SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN)
+ tab_id = WebsiteSettingsUI::TAB_ID_CONNECTION;
+ ui_->SetSelectedTab(tab_id);
}
void WebsiteSettings::PresentSitePermissions() {