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

Unified Diff: components/infobars/core/infobar_delegate.cc

Issue 2711623003: Update infobars to use VectorIcon struct instead of VectorIconId. (Closed)
Patch Set: rebase Created 3 years, 10 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: components/infobars/core/infobar_delegate.cc
diff --git a/components/infobars/core/infobar_delegate.cc b/components/infobars/core/infobar_delegate.cc
index 4514ed59a763c081c2a6751bf276c5fcebf7e863..9f597fa1cfecce5c4600892a654e848e40f74e01 100644
--- a/components/infobars/core/infobar_delegate.cc
+++ b/components/infobars/core/infobar_delegate.cc
@@ -10,7 +10,7 @@
#include "components/infobars/core/infobar_manager.h"
#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
-#include "ui/gfx/vector_icons_public.h"
+#include "ui/gfx/vector_icon_types.h"
#if !defined(OS_IOS) && !defined(OS_ANDROID)
#include "ui/gfx/color_palette.h"
@@ -37,15 +37,16 @@ int InfoBarDelegate::GetIconId() const {
return kNoIconID;
}
-gfx::VectorIconId InfoBarDelegate::GetVectorIconId() const {
- return gfx::VectorIconId::VECTOR_ICON_NONE;
+const gfx::VectorIcon& InfoBarDelegate::GetVectorIcon() const {
+ CR_DEFINE_STATIC_LOCAL(gfx::VectorIcon, empty_icon, ());
+ return empty_icon;
}
gfx::Image InfoBarDelegate::GetIcon() const {
#if !defined(OS_IOS) && !defined(OS_ANDROID)
- gfx::VectorIconId vector_id = GetVectorIconId();
- if (vector_id != gfx::VectorIconId::VECTOR_ICON_NONE) {
- return gfx::Image(gfx::CreateVectorIcon(vector_id, 16,
+ const gfx::VectorIcon& vector_icon = GetVectorIcon();
+ if (!vector_icon.is_empty()) {
+ return gfx::Image(gfx::CreateVectorIcon(vector_icon, 16,
GetInfoBarType() == WARNING_TYPE
? SkColorSetRGB(0xFF, 0x67, 0)
: gfx::kGoogleBlue500));
« no previous file with comments | « components/infobars/core/infobar_delegate.h ('k') | components/infobars/core/simple_alert_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698