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

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

Issue 1410293003: Vectorize LocationIconView icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review Created 5 years, 2 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_impl.cc
diff --git a/chrome/browser/ui/toolbar/toolbar_model_impl.cc b/chrome/browser/ui/toolbar/toolbar_model_impl.cc
index 3bdae4af5868f8e61e93fe9b4ed2d9327f65be75..7fbef55afbf7cfaabf736b8383932e2e866a605d 100644
--- a/chrome/browser/ui/toolbar/toolbar_model_impl.cc
+++ b/chrome/browser/ui/toolbar/toolbar_model_impl.cc
@@ -33,6 +33,7 @@
#include "net/cert/x509_certificate.h"
#include "net/ssl/ssl_connection_status_flags.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/vector_icons_public.h"
using content::NavigationController;
using content::NavigationEntry;
@@ -153,6 +154,34 @@ int ToolbarModelImpl::GetIconForSecurityLevel(
return IDR_LOCATION_BAR_HTTP;
}
+gfx::VectorIconId ToolbarModelImpl::GetVectorIcon() const {
+ DCHECK(!WouldPerformSearchTermReplacement(false));
+ return GetVectorIconForSecurityLevel(GetSecurityLevel(false));
+}
+
+gfx::VectorIconId ToolbarModelImpl::GetVectorIconForSecurityLevel(
+ SecurityStateModel::SecurityLevel level) const {
+#if !defined(OS_ANDROID) && !defined(OS_MACOSX) && !defined(OS_IOS)
+ switch (level) {
+ case SecurityStateModel::NONE:
+ return gfx::VectorIconId::LOCATION_BAR_HTTP;
+ case SecurityStateModel::EV_SECURE:
+ case SecurityStateModel::SECURE:
+ return gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID;
+ case SecurityStateModel::SECURITY_WARNING:
+ // Surface Dubious as Neutral.
+ return gfx::VectorIconId::LOCATION_BAR_HTTP;
+ case SecurityStateModel::SECURITY_POLICY_WARNING:
+ return gfx::VectorIconId::BUSINESS;
+ case SecurityStateModel::SECURITY_ERROR:
+ return gfx::VectorIconId::LOCATION_BAR_HTTPS_INVALID;
+ }
+#endif
+
+ NOTREACHED();
+ return gfx::VectorIconId::LOCATION_BAR_HTTP;
+}
+
base::string16 ToolbarModelImpl::GetEVCertName() const {
if (GetSecurityLevel(false) != SecurityStateModel::EV_SECURE)
return base::string16();
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_model_impl.h ('k') | chrome/browser/ui/views/location_bar/location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698