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

Side by Side Diff: components/toolbar/toolbar_model_impl.cc

Issue 2144903004: New location security strings and animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unnecessary method, formatting Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/toolbar/toolbar_model_impl.h" 5 #include "components/toolbar/toolbar_model_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 // EV are required to have an organization name and country. 136 // EV are required to have an organization name and country.
137 DCHECK(!cert->subject().organization_names.empty()); 137 DCHECK(!cert->subject().organization_names.empty());
138 DCHECK(!cert->subject().country_name.empty()); 138 DCHECK(!cert->subject().country_name.empty());
139 return l10n_util::GetStringFUTF16( 139 return l10n_util::GetStringFUTF16(
140 IDS_SECURE_CONNECTION_EV, 140 IDS_SECURE_CONNECTION_EV,
141 base::UTF8ToUTF16(cert->subject().organization_names[0]), 141 base::UTF8ToUTF16(cert->subject().organization_names[0]),
142 base::UTF8ToUTF16(cert->subject().country_name)); 142 base::UTF8ToUTF16(cert->subject().country_name));
143 } 143 }
144 144
145 base::string16 ToolbarModelImpl::GetSecureVerboseText() const {
146 switch (GetSecurityLevel(false)) {
147 case SecurityStateModel::EV_SECURE:
148 case SecurityStateModel::SECURE:
149 return l10n_util::GetStringUTF16(IDS_SECURE_VERBOSE_HTTPS);
150 case SecurityStateModel::SECURITY_ERROR:
151 case SecurityStateModel::SECURITY_WARNING:
152 case SecurityStateModel::SECURITY_POLICY_WARNING:
153 return l10n_util::GetStringUTF16(IDS_SECURE_VERBOSE_DANGEROUS);
154 case SecurityStateModel::NONE:
155 return l10n_util::GetStringUTF16(IDS_SECURE_VERBOSE_HTTP);
156 }
157
158 NOTREACHED();
Peter Kasting 2016/08/15 23:29:50 You may get a compiler warning about not all contr
Kevin Bailey 2016/08/16 16:39:37 I don't appear to, but I'm happy to remove any dou
159 }
160
145 bool ToolbarModelImpl::ShouldDisplayURL() const { 161 bool ToolbarModelImpl::ShouldDisplayURL() const {
146 return delegate_->ShouldDisplayURL(); 162 return delegate_->ShouldDisplayURL();
147 } 163 }
148 164
165 scoped_refptr<net::X509Certificate> ToolbarModelImpl::GetCertificate() const {
166 return delegate_->GetCertificate();
167 }
168
149 base::string16 ToolbarModelImpl::GetSearchTerms(bool ignore_editing) const { 169 base::string16 ToolbarModelImpl::GetSearchTerms(bool ignore_editing) const {
150 if (!url_replacement_enabled() || (input_in_progress() && !ignore_editing)) 170 if (!url_replacement_enabled() || (input_in_progress() && !ignore_editing))
151 return base::string16(); 171 return base::string16();
152 172
153 return delegate_->GetSearchTerms(GetSecurityLevel(ignore_editing)); 173 return delegate_->GetSearchTerms(GetSecurityLevel(ignore_editing));
154 } 174 }
OLDNEW
« components/omnibox_strings.grdp ('K') | « components/toolbar/toolbar_model_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698