| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_STYLE_PLATFORM_STYLE_H_ | 5 #ifndef UI_VIEWS_STYLE_PLATFORM_STYLE_H_ |
| 6 #define UI_VIEWS_STYLE_PLATFORM_STYLE_H_ | 6 #define UI_VIEWS_STYLE_PLATFORM_STYLE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/views/controls/button/button.h" | 10 #include "ui/views/controls/button/button.h" |
| 11 #include "ui/views/controls/combobox/combobox.h" |
| 11 | 12 |
| 12 namespace views { | 13 namespace views { |
| 13 | 14 |
| 14 class Border; | 15 class Border; |
| 15 class FocusableBorder; | 16 class FocusableBorder; |
| 16 class LabelButton; | 17 class LabelButton; |
| 17 class LabelButtonBorder; | 18 class LabelButtonBorder; |
| 18 class ScrollBar; | 19 class ScrollBar; |
| 19 | 20 |
| 20 // Cross-platform API for providing platform-specific styling for toolkit-views. | 21 // Cross-platform API for providing platform-specific styling for toolkit-views. |
| 21 class PlatformStyle { | 22 class PlatformStyle { |
| 22 public: | 23 public: |
| 24 // Creates an ImageSkia containing the image to use for the combobox arrow. |
| 25 // The |is_enabled| argument is true if the control the arrow is for is |
| 26 // enabled, and false if the control is disabled. The |style| argument is the |
| 27 // style of the combobox the arrow is being drawn for. |
| 28 static gfx::ImageSkia CreateComboboxArrow(bool is_enabled, |
| 29 Combobox::Style style); |
| 30 |
| 23 // Creates the appropriate border for a focusable Combobox. | 31 // Creates the appropriate border for a focusable Combobox. |
| 24 static scoped_ptr<FocusableBorder> CreateComboboxBorder(); | 32 static scoped_ptr<FocusableBorder> CreateComboboxBorder(); |
| 25 | 33 |
| 26 // Creates the appropriate background for a Combobox. | 34 // Creates the appropriate background for a Combobox. |
| 27 static scoped_ptr<Background> CreateComboboxBackground(); | 35 static scoped_ptr<Background> CreateComboboxBackground(); |
| 28 | 36 |
| 29 // Creates the default label button border for the given |style|. Used when a | 37 // Creates the default label button border for the given |style|. Used when a |
| 30 // custom default border is not provided for a particular LabelButton class. | 38 // custom default border is not provided for a particular LabelButton class. |
| 31 static scoped_ptr<LabelButtonBorder> CreateLabelButtonBorder( | 39 static scoped_ptr<LabelButtonBorder> CreateLabelButtonBorder( |
| 32 Button::ButtonStyle style); | 40 Button::ButtonStyle style); |
| 33 | 41 |
| 34 // Applies the current system theme to the default border created by |button|. | 42 // Applies the current system theme to the default border created by |button|. |
| 35 static scoped_ptr<Border> CreateThemedLabelButtonBorder(LabelButton* button); | 43 static scoped_ptr<Border> CreateThemedLabelButtonBorder(LabelButton* button); |
| 36 | 44 |
| 37 // Creates the default scrollbar for the given orientation. | 45 // Creates the default scrollbar for the given orientation. |
| 38 static scoped_ptr<ScrollBar> CreateScrollBar(bool is_horizontal); | 46 static scoped_ptr<ScrollBar> CreateScrollBar(bool is_horizontal); |
| 39 | 47 |
| 40 private: | 48 private: |
| 41 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformStyle); | 49 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformStyle); |
| 42 }; | 50 }; |
| 43 | 51 |
| 44 } // namespace views | 52 } // namespace views |
| 45 | 53 |
| 46 #endif // UI_VIEWS_STYLE_PLATFORM_STYLE_H_ | 54 #endif // UI_VIEWS_STYLE_PLATFORM_STYLE_H_ |
| OLD | NEW |