| Index: chrome/browser/ui/toolbar/toolbar_model_impl.cc
|
| diff --git a/chrome/browser/ui/toolbar/toolbar_model_impl.cc b/chrome/browser/ui/toolbar/toolbar_model_impl.cc
|
| index d4df2bbe267f875465069869a95781f169b672ae..9ade28c491c2dd6ec6a9727f0f219807f3630ab2 100644
|
| --- a/chrome/browser/ui/toolbar/toolbar_model_impl.cc
|
| +++ b/chrome/browser/ui/toolbar/toolbar_model_impl.cc
|
| @@ -95,19 +95,6 @@ ToolbarModel::SecurityLevel ToolbarModelImpl::GetSecurityLevelForWebContents(
|
| }
|
| }
|
|
|
| -// static
|
| -base::string16 ToolbarModelImpl::GetEVCertName(
|
| - const net::X509Certificate& cert) {
|
| - // EV are required to have an organization name and country.
|
| - DCHECK(!cert.subject().organization_names.empty());
|
| - DCHECK(!cert.subject().country_name.empty());
|
| -
|
| - return l10n_util::GetStringFUTF16(
|
| - IDS_SECURE_CONNECTION_EV,
|
| - base::UTF8ToUTF16(cert.subject().organization_names[0]),
|
| - base::UTF8ToUTF16(cert.subject().country_name));
|
| -}
|
| -
|
| // ToolbarModelImpl Implementation.
|
| base::string16 ToolbarModelImpl::GetText() const {
|
| base::string16 search_terms(GetSearchTerms(false));
|
| @@ -207,13 +194,22 @@ int ToolbarModelImpl::GetIconForSecurityLevel(SecurityLevel level) const {
|
| }
|
|
|
| base::string16 ToolbarModelImpl::GetEVCertName() const {
|
| - DCHECK_EQ(EV_SECURE, GetSecurityLevel(false));
|
| - scoped_refptr<net::X509Certificate> cert;
|
| + if (GetSecurityLevel(false) != EV_SECURE)
|
| + return base::string16();
|
| +
|
| // Note: Navigation controller and active entry are guaranteed non-NULL or
|
| // the security level would be NONE.
|
| + scoped_refptr<net::X509Certificate> cert;
|
| content::CertStore::GetInstance()->RetrieveCert(
|
| GetNavigationController()->GetVisibleEntry()->GetSSL().cert_id, &cert);
|
| - return GetEVCertName(*cert.get());
|
| +
|
| + // EV are required to have an organization name and country.
|
| + DCHECK(!cert->subject().organization_names.empty());
|
| + DCHECK(!cert->subject().country_name.empty());
|
| + return l10n_util::GetStringFUTF16(
|
| + IDS_SECURE_CONNECTION_EV,
|
| + base::UTF8ToUTF16(cert->subject().organization_names[0]),
|
| + base::UTF8ToUTF16(cert->subject().country_name));
|
| }
|
|
|
| bool ToolbarModelImpl::ShouldDisplayURL() const {
|
|
|