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

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

Issue 2305933002: Update dialog close buttons to use vector icons and ripples. (Closed)
Patch Set: Created 4 years, 3 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 | « ui/views/bubble/bubble_frame_view.cc ('k') | ui/views/controls/button/vector_icon_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/vector_icon_button.h
diff --git a/chrome/browser/ui/views/bar_control_button.h b/ui/views/controls/button/vector_icon_button.h
similarity index 53%
rename from chrome/browser/ui/views/bar_control_button.h
rename to ui/views/controls/button/vector_icon_button.h
index 902f328b90dd17867e767c4cdbd4416878264eee..b093abb1089e0222c566b7c4684aa77b118ab129 100644
--- a/chrome/browser/ui/views/bar_control_button.h
+++ b/ui/views/controls/button/vector_icon_button.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_UI_VIEWS_BAR_CONTROL_BUTTON_H_
-#define CHROME_BROWSER_UI_VIEWS_BAR_CONTROL_BUTTON_H_
+#ifndef UI_VIEWS_CONTROLS_BUTTON_VECTOR_ICON_BUTTON_H_
+#define UI_VIEWS_CONTROLS_BUTTON_VECTOR_ICON_BUTTON_H_
#include <memory>
@@ -15,19 +15,23 @@ namespace gfx {
enum class VectorIconId;
}
-// A class for buttons that control bars (find bar, download shelf, etc.). The
-// button has an image and no text.
-class BarControlButton : public views::ImageButton {
+namespace views {
+
+// A button that has an image and no text, with the image defined by a vector
+// icon identifier.
+class VectorIconButton : public views::ImageButton {
public:
- explicit BarControlButton(views::ButtonListener* listener);
- ~BarControlButton() override;
+ explicit VectorIconButton(views::ButtonListener* listener);
+ ~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. If the callback is null,
+ // the color will default to kChromeIconGrey.
void SetIcon(gfx::VectorIconId id,
const base::Callback<SkColor(void)>& get_text_color_callback);
sky 2016/09/06 21:22:47 I would prefer not to put this class in views beca
Evan Stade 2016/09/06 21:45:55 I can get rid of the kChromeIconGrey pretty easily
// views::ImageButton:
+ void OnEnabledChanged() override;
void OnThemeChanged() override;
void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
@@ -35,7 +39,9 @@ class BarControlButton : public views::ImageButton {
gfx::VectorIconId id_;
base::Callback<SkColor(void)> get_text_color_callback_;
- DISALLOW_COPY_AND_ASSIGN(BarControlButton);
+ DISALLOW_COPY_AND_ASSIGN(VectorIconButton);
};
-#endif // CHROME_BROWSER_UI_VIEWS_BAR_CONTROL_BUTTON_H_
+} // namespace views
+
+#endif // UI_VIEWS_CONTROLS_BUTTON_VECTOR_ICON_BUTTON_H_
« no previous file with comments | « ui/views/bubble/bubble_frame_view.cc ('k') | ui/views/controls/button/vector_icon_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698