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

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: fix RTL support Created 4 years, 8 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 49
50 // Creates the default label button border for the given |style|. Used when a 50 // 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. 51 // custom default border is not provided for a particular LabelButton class.
52 static std::unique_ptr<LabelButtonBorder> CreateLabelButtonBorder( 52 static std::unique_ptr<LabelButtonBorder> CreateLabelButtonBorder(
53 Button::ButtonStyle style); 53 Button::ButtonStyle style);
54 54
55 // Creates an ImageSkia containing the image to use for the menubutton arrow.
56 static gfx::ImageSkia CreateMenuButtonArrow(bool is_enabled);
57
58 // Create the appropriate background for a MenuButton.
59 static std::unique_ptr<Background> CreateMenuButtonBackground();
60
61 // Create the appropriate border for a MenuButton.
62 static std::unique_ptr<FocusableBorder> CreateMenuButtonBorder();
63
64 // A combobox or menubutton looks like this:
65 // ------------------------------------
66 // | text field ............. | arrow |
67 // ------------------------------------
68 // These functions return the width of the arrow part. This includes the arrow
69 // image itself as well as any padding on either side of it. On Mac, this is
70 // the width that will be filled by the arrow button's background, so text
71 // must not encroach upon it.
72 static int GetComboboxArrowWidth(Combobox::Style style);
tapted 2016/04/21 06:06:46 At this point "shoulder" is really starting to gro
Elly Fong-Jones 2016/04/21 15:30:27 Done.
73 static int GetMenuButtonArrowWidth();
74
55 // Creates the default scrollbar for the given orientation. 75 // Creates the default scrollbar for the given orientation.
56 static std::unique_ptr<ScrollBar> CreateScrollBar(bool is_horizontal); 76 static std::unique_ptr<ScrollBar> CreateScrollBar(bool is_horizontal);
57 77
58 // Returns the current text color for the current button state. 78 // Returns the current text color for the current button state.
59 static SkColor TextColorForButton(const ButtonColorByState& color_by_state, 79 static SkColor TextColorForButton(const ButtonColorByState& color_by_state,
60 const LabelButton& button); 80 const LabelButton& button);
61 81
62 // Applies platform styles to |label| and fills |color_by_state| with the text 82 // 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 83 // colors for normal, pressed, hovered, and disabled states, if the colors for
64 // Button::STYLE_BUTTON buttons differ from those provided by ui::NativeTheme. 84 // Button::STYLE_BUTTON buttons differ from those provided by ui::NativeTheme.
65 static void ApplyLabelButtonTextStyle(Label* label, 85 static void ApplyLabelButtonTextStyle(Label* label,
66 ButtonColorByState* color_by_state); 86 ButtonColorByState* color_by_state);
67 87
68 // Applies the current system theme to the default border created by |button|. 88 // Applies the current system theme to the default border created by |button|.
69 static std::unique_ptr<Border> CreateThemedLabelButtonBorder( 89 static std::unique_ptr<Border> CreateThemedLabelButtonBorder(
70 LabelButton* button); 90 LabelButton* button);
71 91
72 private: 92 private:
73 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformStyle); 93 DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformStyle);
74 }; 94 };
75 95
76 } // namespace views 96 } // namespace views
77 97
78 #endif // UI_VIEWS_STYLE_PLATFORM_STYLE_H_ 98 #endif // UI_VIEWS_STYLE_PLATFORM_STYLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698