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

Side by Side Diff: ui/views/controls/button/vector_icon_button.h

Issue 2305933002: Update dialog close buttons to use vector icons and ripples. (Closed)
Patch Set: delegate 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
sky 2016/09/07 03:42:18 2016
Evan Stade 2016/09/07 16:17:37 in my mind this is a file move + rename
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_VIEWS_CONTROLS_BUTTON_VECTOR_ICON_BUTTON_H_
6 #define UI_VIEWS_CONTROLS_BUTTON_VECTOR_ICON_BUTTON_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "ui/views/controls/button/image_button.h"
12
13 namespace gfx {
14 enum class VectorIconId;
15 }
16
17 namespace views {
18
19 // A ButtonListener that also provides a color to use for drawing an icon.
20 class VIEWS_EXPORT VectorIconButtonDelegate : public ButtonListener {
sky 2016/09/07 03:42:19 Move to own header as suggested in style guide.
Evan Stade 2016/09/07 16:17:37 Done.
21 public:
22 virtual SkColor GetVectorIconBaseColor() const;
23
24 protected:
25 ~VectorIconButtonDelegate() override {}
26 };
27
28 // A button that has an image and no text, with the image defined by a vector
29 // icon identifier.
30 class VIEWS_EXPORT VectorIconButton : public views::ImageButton {
31 public:
32 explicit VectorIconButton(VectorIconButtonDelegate* delegate);
33 ~VectorIconButton() override;
34
35 // Sets the icon to display and provides a callback which should return the
36 // text color from which to derive this icon's color.
37 void SetIcon(gfx::VectorIconId id);
38
39 // views::ImageButton:
40 void OnEnabledChanged() override;
41 void OnThemeChanged() override;
42 void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
43
44 private:
45 VectorIconButtonDelegate* delegate_;
46 gfx::VectorIconId id_;
47
48 DISALLOW_COPY_AND_ASSIGN(VectorIconButton);
49 };
50
51 } // namespace views
52
53 #endif // UI_VIEWS_CONTROLS_BUTTON_VECTOR_ICON_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698