Chromium Code Reviews| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 // the left or right end of the text from the cursor, respectively. | 46 // the left or right end of the text from the cursor, respectively. |
| 47 static const bool kTextfieldDragVerticallyDragsToEnd; | 47 static const bool kTextfieldDragVerticallyDragsToEnd; |
| 48 | 48 |
| 49 // The menu button's action to show the menu. | 49 // The menu button's action to show the menu. |
| 50 static const CustomButton::NotifyAction kMenuNotifyActivationAction; | 50 static const CustomButton::NotifyAction kMenuNotifyActivationAction; |
| 51 | 51 |
| 52 // Whether selecting a row in a TreeView selects the entire row or only the | 52 // Whether selecting a row in a TreeView selects the entire row or only the |
| 53 // label for that row. | 53 // label for that row. |
| 54 static const bool kTreeViewSelectionPaintsEntireRow; | 54 static const bool kTreeViewSelectionPaintsEntireRow; |
| 55 | 55 |
| 56 // Whether ripples should be used for visual feedback on control activation. | |
| 57 static const bool kUseRipples; | |
|
sky
2016/08/25 23:44:50
Is there a reason you're going with the more gener
Elly Fong-Jones
2016/08/26 15:46:44
In principle, there could be other kinds of ripple
| |
| 58 | |
| 56 // Creates an ImageSkia containing the image to use for the combobox arrow. | 59 // Creates an ImageSkia containing the image to use for the combobox arrow. |
| 57 // The |is_enabled| argument is true if the control the arrow is for is | 60 // The |is_enabled| argument is true if the control the arrow is for is |
| 58 // enabled, and false if the control is disabled. The |style| argument is the | 61 // enabled, and false if the control is disabled. The |style| argument is the |
| 59 // style of the combobox the arrow is being drawn for. | 62 // style of the combobox the arrow is being drawn for. |
| 60 static gfx::ImageSkia CreateComboboxArrow(bool is_enabled, | 63 static gfx::ImageSkia CreateComboboxArrow(bool is_enabled, |
| 61 Combobox::Style style); | 64 Combobox::Style style); |
| 62 | 65 |
| 63 // Creates the appropriate border for a focusable Combobox. | 66 // Creates the appropriate border for a focusable Combobox. |
| 64 static std::unique_ptr<FocusableBorder> CreateComboboxBorder(); | 67 static std::unique_ptr<FocusableBorder> CreateComboboxBorder(); |
| 65 | 68 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 78 // Returns the current text color for the current button state. | 81 // Returns the current text color for the current button state. |
| 79 static SkColor TextColorForButton(const ButtonColorByState& color_by_state, | 82 static SkColor TextColorForButton(const ButtonColorByState& color_by_state, |
| 80 const LabelButton& button); | 83 const LabelButton& button); |
| 81 | 84 |
| 82 // Applies platform styles to |label| and fills |color_by_state| with the text | 85 // Applies platform styles to |label| and fills |color_by_state| with the text |
| 83 // colors for normal, pressed, hovered, and disabled states, if the colors for | 86 // colors for normal, pressed, hovered, and disabled states, if the colors for |
| 84 // Button::STYLE_BUTTON buttons differ from those provided by ui::NativeTheme. | 87 // Button::STYLE_BUTTON buttons differ from those provided by ui::NativeTheme. |
| 85 static void ApplyLabelButtonTextStyle(Label* label, | 88 static void ApplyLabelButtonTextStyle(Label* label, |
| 86 ButtonColorByState* color_by_state); | 89 ButtonColorByState* color_by_state); |
| 87 | 90 |
| 91 // Returns the background color that should be used for an MdTextButton or | |
| 92 // other MD controls when in the given state. | |
| 93 static SkColor BackgroundColorForMdButton(SkColor color, | |
| 94 Button::ButtonState state); | |
| 95 | |
| 88 // Applies the current system theme to the default border created by |button|. | 96 // Applies the current system theme to the default border created by |button|. |
| 89 static std::unique_ptr<Border> CreateThemedLabelButtonBorder( | 97 static std::unique_ptr<Border> CreateThemedLabelButtonBorder( |
| 90 LabelButton* button); | 98 LabelButton* button); |
| 91 | 99 |
| 92 private: | 100 private: |
| 93 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformStyle); | 101 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformStyle); |
| 94 }; | 102 }; |
| 95 | 103 |
| 96 } // namespace views | 104 } // namespace views |
| 97 | 105 |
| 98 #endif // UI_VIEWS_STYLE_PLATFORM_STYLE_H_ | 106 #endif // UI_VIEWS_STYLE_PLATFORM_STYLE_H_ |
| OLD | NEW |