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

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_model_impl.cc

Issue 128033004: Fix the policy-pushed-certs omnibox icon. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/app/theme/theme_resources.grd ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/ui/toolbar/toolbar_model_impl.h" 5 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 10 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 return GetIconForSecurityLevel(GetSecurityLevel(false)); 215 return GetIconForSecurityLevel(GetSecurityLevel(false));
216 } 216 }
217 217
218 int ToolbarModelImpl::GetIconForSecurityLevel(SecurityLevel level) const { 218 int ToolbarModelImpl::GetIconForSecurityLevel(SecurityLevel level) const {
219 static int icon_ids[NUM_SECURITY_LEVELS] = { 219 static int icon_ids[NUM_SECURITY_LEVELS] = {
220 IDR_LOCATION_BAR_HTTP, 220 IDR_LOCATION_BAR_HTTP,
221 IDR_OMNIBOX_HTTPS_VALID, 221 IDR_OMNIBOX_HTTPS_VALID,
222 IDR_OMNIBOX_HTTPS_VALID, 222 IDR_OMNIBOX_HTTPS_VALID,
223 IDR_OMNIBOX_HTTPS_WARNING, 223 IDR_OMNIBOX_HTTPS_WARNING,
224 IDR_OMNIBOX_HTTPS_POLICY_WARNING, 224 IDR_CONTROLLED_SETTING_MANDATORY,
sky 2014/01/08 15:17:44 I think it better to keep the name IDR_OMNIBOX_HTT
dconnelly 2014/01/08 15:35:27 Done.
225 IDR_OMNIBOX_HTTPS_INVALID, 225 IDR_OMNIBOX_HTTPS_INVALID,
226 }; 226 };
227 DCHECK(arraysize(icon_ids) == NUM_SECURITY_LEVELS); 227 DCHECK(arraysize(icon_ids) == NUM_SECURITY_LEVELS);
228 return icon_ids[level]; 228 return icon_ids[level];
229 } 229 }
230 230
231 base::string16 ToolbarModelImpl::GetEVCertName() const { 231 base::string16 ToolbarModelImpl::GetEVCertName() const {
232 DCHECK_EQ(EV_SECURE, GetSecurityLevel(false)); 232 DCHECK_EQ(EV_SECURE, GetSecurityLevel(false));
233 scoped_refptr<net::X509Certificate> cert; 233 scoped_refptr<net::X509Certificate> cert;
234 // Note: Navigation controller and active entry are guaranteed non-NULL or 234 // Note: Navigation controller and active entry are guaranteed non-NULL or
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 if (entry && 297 if (entry &&
298 google_util::StartsWithCommandLineGoogleBaseURL(entry->GetVirtualURL())) 298 google_util::StartsWithCommandLineGoogleBaseURL(entry->GetVirtualURL()))
299 return search_terms; 299 return search_terms;
300 300
301 // Otherwise, extract search terms for HTTPS pages that do not have a security 301 // Otherwise, extract search terms for HTTPS pages that do not have a security
302 // error. 302 // error.
303 ToolbarModel::SecurityLevel security_level = GetSecurityLevel(ignore_editing); 303 ToolbarModel::SecurityLevel security_level = GetSecurityLevel(ignore_editing);
304 return ((security_level == NONE) || (security_level == SECURITY_ERROR)) ? 304 return ((security_level == NONE) || (security_level == SECURITY_ERROR)) ?
305 base::string16() : search_terms; 305 base::string16() : search_terms;
306 } 306 }
OLDNEW
« no previous file with comments | « chrome/app/theme/theme_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698