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

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: fix android Created 5 years, 1 month 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 4af29ad07be9f3ebada88fc6ca98337986e9b186..0cefbc6b0e367c96cecee20b110e111835a707ad 100644
--- a/chrome/browser/ui/toolbar/toolbar_model_impl.cc
+++ b/chrome/browser/ui/toolbar/toolbar_model_impl.cc
@@ -35,6 +35,7 @@
#include "net/ssl/ssl_connection_status_flags.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/text_elider.h"
+#include "ui/gfx/vector_icons_public.h"
using content::NavigationController;
using content::NavigationEntry;
@@ -138,15 +139,7 @@ SecurityStateModel::SecurityLevel ToolbarModelImpl::GetSecurityLevel(
}
int ToolbarModelImpl::GetIcon() const {
- if (WouldPerformSearchTermReplacement(false))
- return IDR_OMNIBOX_SEARCH_SECURED;
-
- return GetIconForSecurityLevel(GetSecurityLevel(false));
-}
-
-int ToolbarModelImpl::GetIconForSecurityLevel(
- SecurityStateModel::SecurityLevel level) const {
- switch (level) {
+ switch (GetSecurityLevel(false)) {
case SecurityStateModel::NONE:
return IDR_LOCATION_BAR_HTTP;
case SecurityStateModel::EV_SECURE:
@@ -165,6 +158,28 @@ int ToolbarModelImpl::GetIconForSecurityLevel(
return IDR_LOCATION_BAR_HTTP;
}
+gfx::VectorIconId ToolbarModelImpl::GetVectorIcon() const {
+#if !defined(OS_ANDROID) && !defined(OS_MACOSX) && !defined(OS_IOS)
+ switch (GetSecurityLevel(false)) {
+ 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::VECTOR_ICON_NONE;
+}
+
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