From 24c8818cc2546b92de0e7b2cdc95eba51bd99379 Mon Sep 17 00:00:00 2001 From: "markusheintz@chromium.org" Date: Wed, 25 Apr 2012 09:57:41 +0000 Subject: Display site permissions in a tab and add a tab to display information about the site's identity and the site's connection. UI string changes: https://chromiumcodereview.appspot.com/10180002/ BUG=113688 TEST=WebsiteSettingsTest* Review URL: https://chromiumcodereview.appspot.com/10163002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133886 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/website_settings.cc | 43 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'chrome/browser/website_settings.cc') diff --git a/chrome/browser/website_settings.cc b/chrome/browser/website_settings.cc index 5850576..d63ccf9 100644 --- a/chrome/browser/website_settings.cc +++ b/chrome/browser/website_settings.cc @@ -84,31 +84,10 @@ WebsiteSettings::WebsiteSettings( content_settings_(profile->GetHostContentSettingsMap()) { ui_->SetPresenter(this); Init(profile, url, ssl); - // After initialization the status about the site's connection - // and it's identity must be available. - DCHECK_NE(site_identity_status_, SITE_IDENTITY_STATUS_UNKNOWN); - DCHECK_NE(site_connection_status_, SITE_CONNECTION_STATUS_UNKNOWN); - - // TODO(markusheintz): Add the strings below to the grd file once a decision - // has been made about the exact wording. - std::string site_info; - switch (site_identity_status_) { - case WebsiteSettings::SITE_IDENTITY_STATUS_CERT: - case WebsiteSettings::SITE_IDENTITY_STATUS_DNSSEC_CERT: - site_info = "Identity verified"; - break; - case WebsiteSettings::SITE_IDENTITY_STATUS_EV_CERT: - site_info = UTF16ToUTF8(organization_name()); - site_info += " - Identity verified"; - break; - default: - site_info = "Identity not verified"; - break; - } - ui_->SetSiteInfo(site_info); PresentSitePermissions(); PresentSiteData(); + PresentSiteIdentity(); } WebsiteSettings::~WebsiteSettings() { @@ -445,6 +424,26 @@ void WebsiteSettings::PresentSiteData() { ui_->SetCookieInfo(cookie_info_list); } +void WebsiteSettings::PresentSiteIdentity() { + // After initialization the status about the site's connection + // and it's identity must be available. + DCHECK_NE(site_identity_status_, SITE_IDENTITY_STATUS_UNKNOWN); + DCHECK_NE(site_connection_status_, SITE_CONNECTION_STATUS_UNKNOWN); + WebsiteSettingsUI::IdentityInfo info; + if (site_identity_status_ == SITE_IDENTITY_STATUS_EV_CERT) + info.site_identity = UTF16ToUTF8(organization_name()); + else + info.site_identity = site_url_.host(); + + info.connection_status = site_connection_status_; + info.connection_status_description = + UTF16ToUTF8(site_connection_details_); + info.identity_status = site_identity_status_; + info.identity_status_description = + UTF16ToUTF8(site_identity_details_); + ui_->SetIdentityInfo(info); +} + // static void WebsiteSettings::Show(gfx::NativeWindow parent, Profile* profile, -- cgit v1.1