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

Unified Diff: chrome/browser/ui/toolbar/toolbar_model.cc

Issue 7111013: Move most of the core SSL code from chrome to content. The UI code that's specific to Chrome (i.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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
Index: chrome/browser/ui/toolbar/toolbar_model.cc
===================================================================
--- chrome/browser/ui/toolbar/toolbar_model.cc (revision 87796)
+++ chrome/browser/ui/toolbar/toolbar_model.cc (working copy)
@@ -23,6 +23,7 @@
#include "grit/theme_resources.h"
#include "net/base/cert_status_flags.h"
#include "net/base/net_util.h"
+#include "ui/base/l10n/l10n_util.h"
ToolbarModel::ToolbarModel(Browser* browser)
: browser_(browser),
@@ -120,9 +121,24 @@
// the security level would be NONE.
CertStore::GetInstance()->RetrieveCert(
GetNavigationController()->GetActiveEntry()->ssl().cert_id(), &cert);
- return UTF16ToWideHack(SSLManager::GetEVCertName(*cert));
+ return UTF16ToWideHack(GetEVCertName(*cert));
}
+// static
+string16 ToolbarModel::GetEVCertName(const net::X509Certificate& cert) {
+ // EV are required to have an organization name and country.
+ if (cert.subject().organization_names.empty() ||
+ cert.subject().country_name.empty()) {
+ NOTREACHED();
+ return string16();
+ }
+
+ return l10n_util::GetStringFUTF16(
+ IDS_SECURE_CONNECTION_EV,
+ UTF8ToUTF16(cert.subject().organization_names[0]),
+ UTF8ToUTF16(cert.subject().country_name));
+}
+
NavigationController* ToolbarModel::GetNavigationController() const {
// This |current_tab| can be NULL during the initialization of the
// toolbar during window creation (i.e. before any tabs have been added
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_model.h ('k') | chrome/browser/ui/views/ssl_client_certificate_selector_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698