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

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

Issue 2753833003: Create utility function for configuring an ImageButton to use a vector (Closed)
Patch Set: . 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_
6 #define UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ 6 #define UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "ui/base/layout.h" 12 #include "ui/base/layout.h"
13 #include "ui/gfx/image/image_skia.h" 13 #include "ui/gfx/image/image_skia.h"
14 #include "ui/views/controls/button/custom_button.h" 14 #include "ui/views/controls/button/custom_button.h"
15 15
16 namespace gfx {
17 struct VectorIcon;
18 }
19
16 namespace views { 20 namespace views {
17 21
18 class Painter; 22 class Painter;
19 23
20 // An image button. 24 // An image button.
21 // Note that this type of button is not focusable by default and will not be 25 // Note that this type of button is not focusable by default and will not be
22 // part of the focus chain, unless in accessibility mode. Call 26 // part of the focus chain, unless in accessibility mode. Call
23 // SetFocusForPlatform() to make it part of the focus chain. 27 // SetFocusForPlatform() to make it part of the focus chain.
24 class VIEWS_EXPORT ImageButton : public CustomButton { 28 class VIEWS_EXPORT ImageButton : public CustomButton {
25 public: 29 public:
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // True if the button is currently toggled. 167 // True if the button is currently toggled.
164 bool toggled_; 168 bool toggled_;
165 169
166 // The parent class's tooltip_text_ is displayed when not toggled, and 170 // The parent class's tooltip_text_ is displayed when not toggled, and
167 // this one is shown when toggled. 171 // this one is shown when toggled.
168 base::string16 toggled_tooltip_text_; 172 base::string16 toggled_tooltip_text_;
169 173
170 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton); 174 DISALLOW_COPY_AND_ASSIGN(ToggleImageButton);
171 }; 175 };
172 176
177 // Sets up |button| as a button that displays an ink drop and a vector icon.
178 // TODO(estade): find the right place for this utility.
179 void VIEWS_EXPORT SetImageFromVectorIcon(ImageButton* button,
180 const gfx::VectorIcon& icon,
181 SkColor base_color);
182
173 } // namespace views 183 } // namespace views
174 184
175 #endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_ 185 #endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698