Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Unified Diff: chrome/browser/page_info_model.cc

Issue 3033001: Add connection details to the page info dialog. (Closed)
Patch Set: ... Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« chrome/app/generated_resources.grd ('K') | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/page_info_model.cc
diff --git a/chrome/browser/page_info_model.cc b/chrome/browser/page_info_model.cc
index da20fa285ed61c9dca55704adfb83a8d170abe30..022c88f3480f432610be0f92f8104f32452756e0 100644
--- a/chrome/browser/page_info_model.cc
+++ b/chrome/browser/page_info_model.cc
@@ -17,6 +17,8 @@
#include "chrome/common/pref_names.h"
#include "grit/generated_resources.h"
#include "net/base/cert_status_flags.h"
+#include "net/base/ssl_connection_status_flags.h"
+#include "net/base/ssl_cipher_suite_names.h"
#include "net/base/x509_certificate.h"
namespace {
@@ -133,8 +135,7 @@ PageInfoModel::PageInfoModel(Profile* profile,
} else {
description.assign(l10n_util::GetStringFUTF16(
IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_CONNECTION_TEXT,
- subject_name,
- IntToString16(ssl.security_bits())));
+ subject_name));
if (ssl.displayed_insecure_content() || ssl.ran_insecure_content()) {
state = false;
description.assign(l10n_util::GetStringFUTF16(
@@ -145,6 +146,42 @@ PageInfoModel::PageInfoModel(Profile* profile,
IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_WARNING)));
}
}
+
+ uint16_t cipher_suite =
wtc 2010/07/16 20:07:10 Question: are we supposed to use uint16_t instead
agl 2010/07/18 17:03:49 I haven't heard so. I tend to use _t because it's
+ ((ssl.connection_status() >> net::SSL_CONNECTION_CIPHERSUITE_SHIFT) &
+ net::SSL_CONNECTION_CIPHERSUITE_MASK);
+ if (ssl.security_bits() > 0 && cipher_suite) {
+ uint8_t compression_id =
+ ((ssl.connection_status() >> net::SSL_CONNECTION_COMPRESSION_SHIFT) &
+ net::SSL_CONNECTION_COMPRESSION_MASK);
+ bool did_fallback = ssl.connection_status() &
+ net::SSL_CONNECTION_SSL3_FALLBACK;
+ bool no_renegotiation = ssl.connection_status() &
+ net::SSL_CONNECTION_NO_RENEGOTIATION_EXTENSION;
+ // For now, only SSLv3 fallback will trigger a warning icon here.
+ state = !did_fallback;
+ const char *key_exchange, *cipher, *mac, *compression;
+ net::SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, cipher_suite);
+ net::SSLCompressionToString(&compression, compression_id);
+
+ description += ASCIIToUTF16("\n\n");
wtc 2010/07/16 20:07:10 Can we add "\n\n" here? Are there some languages
agl 2010/07/18 17:03:49 I wondered about that also, but I believe that we'
+ description += l10n_util::GetStringFUTF16(
+ IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS,
+ ASCIIToUTF16(cipher), ASCIIToUTF16(mac), ASCIIToUTF16(key_exchange),
+ ASCIIToUTF16(compression));
+
+ if (did_fallback) {
+ description += ASCIIToUTF16("\n\n");
+ description += l10n_util::GetStringUTF16(
+ IDS_PAGE_INFO_SECURITY_TAB_FALLBACK_MESSAGE);
+ }
+ if (no_renegotiation) {
+ description += ASCIIToUTF16("\n\n");
+ description += l10n_util::GetStringUTF16(
+ IDS_PAGE_INFO_SECURITY_TAB_RENEGOTIATION_MESSAGE);
+ }
+ }
+
sections_.push_back(SectionInfo(
state,
l10n_util::GetStringUTF16(IDS_PAGE_INFO_SECURITY_TAB_CONNECTION_TITLE),
« chrome/app/generated_resources.grd ('K') | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698