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

Side by Side Diff: ui/views/style/platform_style.h

Issue 1904753002: MenuButton: support Mac look & feel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add basic tests Created 4 years, 7 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 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // The |is_enabled| argument is true if the control the arrow is for is 42 // The |is_enabled| argument is true if the control the arrow is for is
43 // enabled, and false if the control is disabled. The |style| argument is the 43 // enabled, and false if the control is disabled. The |style| argument is the
44 // style of the combobox the arrow is being drawn for. 44 // style of the combobox the arrow is being drawn for.
45 static gfx::ImageSkia CreateComboboxArrow(bool is_enabled, 45 static gfx::ImageSkia CreateComboboxArrow(bool is_enabled,
46 Combobox::Style style); 46 Combobox::Style style);
47 47
48 // Creates the appropriate border for a focusable Combobox. 48 // Creates the appropriate border for a focusable Combobox.
49 static std::unique_ptr<FocusableBorder> CreateComboboxBorder(); 49 static std::unique_ptr<FocusableBorder> CreateComboboxBorder();
50 50
51 // Creates the appropriate background for a Combobox. 51 // Creates the appropriate background for a Combobox.
52 static std::unique_ptr<Background> CreateComboboxBackground(); 52 static std::unique_ptr<Background> CreateComboboxBackground(
53 int shoulder_width);
53 54
54 // Creates the default label button border for the given |style|. Used when a 55 // Creates the default label button border for the given |style|. Used when a
55 // custom default border is not provided for a particular LabelButton class. 56 // custom default border is not provided for a particular LabelButton class.
56 static std::unique_ptr<LabelButtonBorder> CreateLabelButtonBorder( 57 static std::unique_ptr<LabelButtonBorder> CreateLabelButtonBorder(
57 Button::ButtonStyle style); 58 Button::ButtonStyle style);
58 59
60 // Creates an ImageSkia containing the image to use for the menubutton arrow.
61 static gfx::ImageSkia CreateMenuButtonArrow(bool is_enabled);
62
63 // Create the appropriate background for a MenuButton.
64 static std::unique_ptr<Background> CreateMenuButtonBackground(
65 int shoulder_width);
66
67 // Create the appropriate border for a MenuButton.
68 static std::unique_ptr<FocusableBorder> CreateMenuButtonBorder();
69
59 // Creates the default scrollbar for the given orientation. 70 // Creates the default scrollbar for the given orientation.
60 static std::unique_ptr<ScrollBar> CreateScrollBar(bool is_horizontal); 71 static std::unique_ptr<ScrollBar> CreateScrollBar(bool is_horizontal);
61 72
62 // Returns the current text color for the current button state. 73 // Returns the current text color for the current button state.
63 static SkColor TextColorForButton(const ButtonColorByState& color_by_state, 74 static SkColor TextColorForButton(const ButtonColorByState& color_by_state,
64 const LabelButton& button); 75 const LabelButton& button);
65 76
66 // Applies platform styles to |label| and fills |color_by_state| with the text 77 // Applies platform styles to |label| and fills |color_by_state| with the text
67 // colors for normal, pressed, hovered, and disabled states, if the colors for 78 // colors for normal, pressed, hovered, and disabled states, if the colors for
68 // Button::STYLE_BUTTON buttons differ from those provided by ui::NativeTheme. 79 // Button::STYLE_BUTTON buttons differ from those provided by ui::NativeTheme.
69 static void ApplyLabelButtonTextStyle(Label* label, 80 static void ApplyLabelButtonTextStyle(Label* label,
70 ButtonColorByState* color_by_state); 81 ButtonColorByState* color_by_state);
71 82
72 // Applies the current system theme to the default border created by |button|. 83 // Applies the current system theme to the default border created by |button|.
73 static std::unique_ptr<Border> CreateThemedLabelButtonBorder( 84 static std::unique_ptr<Border> CreateThemedLabelButtonBorder(
74 LabelButton* button); 85 LabelButton* button);
75 86
76 private: 87 private:
77 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformStyle); 88 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformStyle);
78 }; 89 };
79 90
80 } // namespace views 91 } // namespace views
81 92
82 #endif // UI_VIEWS_STYLE_PLATFORM_STYLE_H_ 93 #endif // UI_VIEWS_STYLE_PLATFORM_STYLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698