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

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

Issue 2744463002: Add VectorIconButton functionality to ImageButton. (Closed)
Patch Set: WIP: use observer Created 3 years, 9 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 b0aa02515e2408d130f9e476e74f525e820ed348..650681e657ddea61f7c162a409d9d1feaec32ba0 100644
--- a/ui/views/controls/button/vector_icon_button.h
+++ b/ui/views/controls/button/vector_icon_button.h
@@ -17,18 +17,13 @@ namespace views {
class VectorIconButtonDelegate;
-// A button that has an image and no text, with the image defined by a vector
-// icon identifier.
+// A button that has a image from a vector icon and no text.
class VIEWS_EXPORT VectorIconButton : public views::ImageButton {
public:
explicit VectorIconButton(VectorIconButtonDelegate* delegate);
~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. 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);
+ // Sets the icon to display.
void SetIcon(const gfx::VectorIcon& icon);
// views::ImageButton:
@@ -36,16 +31,10 @@ class VIEWS_EXPORT VectorIconButton : public views::ImageButton {
void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
private:
- // Performs the work common to both SetIcon() variants.
- void OnSetIcon();
-
// Called when something may have affected the button's images or colors.
void UpdateImagesAndColors();
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