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

Unified Diff: ui/views/controls/button/vector_icon_button.h

Issue 2618403002: Reland crrev.com/8283cad74e0cad4840d1f with fix for static initializers. (Closed)
Patch Set: re-up 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
Index: ui/views/controls/button/vector_icon_button.h
diff --git a/ui/views/controls/button/vector_icon_button.h b/ui/views/controls/button/vector_icon_button.h
index dd994051a50c1e306b00cecc5b76bb9e010539c5..8a99ae0edfb2604cb0c8747d0f4864a4f2014d2b 100644
--- a/ui/views/controls/button/vector_icon_button.h
+++ b/ui/views/controls/button/vector_icon_button.h
@@ -9,6 +9,7 @@
#include "ui/views/controls/button/image_button.h"
namespace gfx {
+struct VectorIcon;
enum class VectorIconId;
}
@@ -24,8 +25,11 @@ class VIEWS_EXPORT VectorIconButton : public views::ImageButton {
~VectorIconButton() override;
// Sets the icon to display and provides a callback which should return the
- // text color from which to derive this icon's color.
+ // text color from which to derive this icon's color. The one that takes an ID
+ // is deprecated and should be removed when all vector icons are identified by
+ // VectorIcon structs.
void SetIcon(gfx::VectorIconId id);
+ void SetIcon(const gfx::VectorIcon& icon);
// views::ImageButton:
void OnThemeChanged() override;
@@ -33,7 +37,10 @@ class VIEWS_EXPORT VectorIconButton : public views::ImageButton {
private:
VectorIconButtonDelegate* delegate_;
+ // TODO(estade): remove |id_| in favor of |icon_| once all callers have been
+ // updated.
gfx::VectorIconId id_;
+ const gfx::VectorIcon* icon_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(VectorIconButton);
};

Powered by Google App Engine
This is Rietveld 408576698