From c88d24f1f8aaf609db1fdcc06c3a4b5ca528c7ed Mon Sep 17 00:00:00 2001 From: "wtc@chromium.org" Date: Thu, 2 Sep 2010 02:07:44 +0000 Subject: Do not say the connection is not encrypted if security_bits is -1 (unknown). Say nothing in that case. If the description for the connection section is empty, omit the connection section in the dialog. R=finnur,jcivelli BUG=53366,13049 TEST=Visit https://alioth.debian.org/. Bring up the Security info dialog while Chrome is displaying the SSL certificate error page. The security info dialog should not say "Your connection to alioth.debian.org is not encrypted." Review URL: http://codereview.chromium.org/3243008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58302 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/page_info_model.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'chrome/browser/page_info_model.cc') diff --git a/chrome/browser/page_info_model.cc b/chrome/browser/page_info_model.cc index 997e2b6..1f2ffbd 100644 --- a/chrome/browser/page_info_model.cc +++ b/chrome/browser/page_info_model.cc @@ -110,7 +110,10 @@ PageInfoModel::PageInfoModel(Profile* profile, state = SECTION_STATE_OK; headline.clear(); description.clear(); - if (ssl.security_bits() <= 0) { + if (ssl.security_bits() < 0) { + // Security strength is unknown. Say nothing. + state = SECTION_STATE_ERROR; + } else if (ssl.security_bits() == 0) { state = SECTION_STATE_ERROR; description.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT, @@ -184,12 +187,14 @@ PageInfoModel::PageInfoModel(Profile* profile, } } - sections_.push_back(SectionInfo( - state, - l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_CONNECTION_TITLE), - headline, - description, - SECTION_INFO_CONNECTION)); + if (!description.empty()) { + sections_.push_back(SectionInfo( + state, + l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_CONNECTION_TITLE), + headline, + description, + SECTION_INFO_CONNECTION)); + } // Request the number of visits. HistoryService* history = profile->GetHistoryService( -- cgit v1.1