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

Unified Diff: components/toolbar/toolbar_model_impl.cc

Issue 2644903004: Move around more vector icons. (Closed)
Patch Set: fix comment Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/toolbar/toolbar_model_impl.h ('k') | components/toolbar/vector_icons/business.icon » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/toolbar/toolbar_model_impl.cc
diff --git a/components/toolbar/toolbar_model_impl.cc b/components/toolbar/toolbar_model_impl.cc
index e18b120675df17dbc33f49011118632982ddce3f..d2041ee0e6871895f83719ab4458d99ffaa94b78 100644
--- a/components/toolbar/toolbar_model_impl.cc
+++ b/components/toolbar/toolbar_model_impl.cc
@@ -19,7 +19,11 @@
#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"
+#include "ui/gfx/vector_icon_types.h"
+
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+#include "components/toolbar/vector_icons.h" // nogncheck
+#endif
ToolbarModelImpl::ToolbarModelImpl(ToolbarModelDelegate* delegate,
size_t max_url_display_chars)
@@ -67,30 +71,34 @@ security_state::SecurityLevel ToolbarModelImpl::GetSecurityLevel(
: delegate_->GetSecurityLevel();
}
-gfx::VectorIconId ToolbarModelImpl::GetVectorIcon() const {
+const gfx::VectorIcon& ToolbarModelImpl::GetVectorIcon() const {
#if !defined(OS_ANDROID) && !defined(OS_IOS)
const auto icon_override = delegate_->GetVectorIconOverride();
- if (icon_override != gfx::VectorIconId::VECTOR_ICON_NONE)
- return icon_override;
+ if (icon_override)
+ return *icon_override;
switch (GetSecurityLevel(false)) {
case security_state::NONE:
case security_state::HTTP_SHOW_WARNING:
- return gfx::VectorIconId::LOCATION_BAR_HTTP;
+ return toolbar::kHttpIcon;
case security_state::EV_SECURE:
case security_state::SECURE:
- return gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID;
+ return toolbar::kHttpsValidIcon;
case security_state::SECURITY_WARNING:
// Surface Dubious as Neutral.
- return gfx::VectorIconId::LOCATION_BAR_HTTP;
+ return toolbar::kHttpIcon;
case security_state::SECURE_WITH_POLICY_INSTALLED_CERT:
- return gfx::VectorIconId::BUSINESS;
+ return toolbar::kBusinessIcon;
case security_state::DANGEROUS:
- return gfx::VectorIconId::LOCATION_BAR_HTTPS_INVALID;
+ return toolbar::kHttpsInvalidIcon;
}
-#endif
NOTREACHED();
- return gfx::VectorIconId::VECTOR_ICON_NONE;
+ return toolbar::kHttpIcon;
+#else
+ NOTREACHED();
+ static const gfx::VectorIcon dummy = {};
+ return dummy;
+#endif
}
base::string16 ToolbarModelImpl::GetEVCertName() const {
« no previous file with comments | « components/toolbar/toolbar_model_impl.h ('k') | components/toolbar/vector_icons/business.icon » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698