| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 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_IMAGE_BUTTON_FACTORY_H_ |
| 6 #define UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_FACTORY_H_ |
| 7 |
| 8 #include "third_party/skia/include/core/SkColor.h" |
| 9 #include "ui/views/views_export.h" |
| 10 |
| 11 namespace gfx { |
| 12 struct VectorIcon; |
| 13 } |
| 14 |
| 15 namespace views { |
| 16 |
| 17 class ButtonListener; |
| 18 class ImageButton; |
| 19 |
| 20 // Creates an ImageButton with an ink drop and a centered image in preparation |
| 21 // for applying a vector icon with SetImageFromVectorIcon below. |
| 22 VIEWS_EXPORT ImageButton* CreateVectorImageButton(ButtonListener* listener); |
| 23 |
| 24 // Sets images on |button| for STATE_NORMAL and STATE_DISABLED from the given |
| 25 // vector icon and color. |related_text_color| is normally the main text color |
| 26 // used in the parent view, and the actual color used is derived from that. Call |
| 27 // again to update the button if |related_text_color| is changing. |
| 28 VIEWS_EXPORT void SetImageFromVectorIcon( |
| 29 ImageButton* button, |
| 30 const gfx::VectorIcon& icon, |
| 31 SkColor related_text_color = SK_ColorBLACK); |
| 32 |
| 33 } // namespace views |
| 34 |
| 35 #endif // UI_VIEWS_CONTROLS_BUTTON_IMAGE_BUTTON_FACTORY_H_ |
| OLD | NEW |