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

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

Powered by Google App Engine
This is Rietveld 408576698