diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-16 15:54:00 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-16 15:54:00 +0000 |
commit | 7d010c9b8fd7740e388e9b42bf639235ed4840f1 (patch) | |
tree | c80e511b3d2d37d7948201915b21f0c8bb0b7aba /chrome/browser/page_info_model.cc | |
parent | dd680ffab688cb1b9f6ef5c2a8f0973fd839c743 (diff) | |
download | chromium_src-7d010c9b8fd7740e388e9b42bf639235ed4840f1.zip chromium_src-7d010c9b8fd7740e388e9b42bf639235ed4840f1.tar.gz chromium_src-7d010c9b8fd7740e388e9b42bf639235ed4840f1.tar.bz2 |
Revert 62857 (it broke Chrome Frame) - Remove the old SSL Page Info dialog from Win/Gtk. It has been replaced with the PageInfoBubble so it is not in use anymore.
BUG=59030
TEST=None
Review URL: http://codereview.chromium.org/3830001
TBR=finnur@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62862 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/page_info_model.cc')
-rw-r--r-- | chrome/browser/page_info_model.cc | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/chrome/browser/page_info_model.cc b/chrome/browser/page_info_model.cc index 89fb5f92..b0d95ed 100644 --- a/chrome/browser/page_info_model.cc +++ b/chrome/browser/page_info_model.cc @@ -182,8 +182,18 @@ PageInfoModel::PageInfoModel(Profile* profile, subject_name, base::IntToString16(ssl.security_bits()))); if (ssl.displayed_insecure_content() || ssl.ran_insecure_content()) { - icon_id = ssl.ran_insecure_content() ? - ICON_STATE_ERROR : ICON_STATE_WARNING_MINOR; + // The old SSL dialog only had good and bad state, so for the old + // implementation we raise an error on finding mixed content. The new + // SSL info bubble has a warning state for displaying insecure content, + // so we check. The command line check will go away once we eliminate + // the old dialogs. + const CommandLine* command_line(CommandLine::ForCurrentProcess()); + if (!command_line->HasSwitch(switches::kDisableNewPageInfoBubble) && + !ssl.ran_insecure_content()) { + icon_id = ICON_STATE_WARNING_MINOR; + } else { + icon_id = ICON_STATE_ERROR; + } description.assign(l10n_util::GetStringFUTF16( IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_SENTENCE_LINK, description, @@ -279,7 +289,13 @@ PageInfoModel::SectionInfo PageInfoModel::GetSectionInfo(int index) { gfx::NativeImage PageInfoModel::GetIconImage(SectionStateIcon icon_id) { if (icon_id == ICON_NONE) return NULL; - + // TODO(rsesek): Remove once the window is replaced with the bubble. + const CommandLine* command_line(CommandLine::ForCurrentProcess()); + if (command_line->HasSwitch(switches::kDisableNewPageInfoBubble) && + icon_id != ICON_STATE_OK) { + return icons_[ICON_STATE_WARNING_MAJOR]; + } + // The bubble uses new, various icons. return icons_[icon_id]; } @@ -300,7 +316,12 @@ void PageInfoModel::OnGotVisitCountToHost(HistoryService::Handle handle, } // We only show the Site Information heading for the new dialogs. - string16 title = l10n_util::GetStringUTF16(IDS_PAGE_INFO_SITE_INFO_TITLE); + string16 title; + const CommandLine* command_line(CommandLine::ForCurrentProcess()); + bool as_bubble = !command_line->HasSwitch( + switches::kDisableNewPageInfoBubble); + if (as_bubble) + title = l10n_util::GetStringUTF16(IDS_PAGE_INFO_SITE_INFO_TITLE); if (!visited_before_today) { sections_.push_back(SectionInfo( @@ -313,7 +334,8 @@ void PageInfoModel::OnGotVisitCountToHost(HistoryService::Handle handle, SECTION_INFO_FIRST_VISIT)); } else { sections_.push_back(SectionInfo( - ICON_STATE_INFO, + // TODO(rsesek): Remove once the window is replaced with the bubble. + as_bubble ? ICON_STATE_INFO : ICON_STATE_OK, l10n_util::GetStringUTF16( IDS_PAGE_INFO_SECURITY_TAB_PERSONAL_HISTORY_TITLE), title, |