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

Unified Diff: ui/views/style/platform_style.h

Issue 1569113002: MacViews: Style BUTTON_STYLE buttons using the "modern" UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: respond to comments, desktop linux 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/style/platform_style.h
diff --git a/ui/views/style/platform_style.h b/ui/views/style/platform_style.h
index 3103691642a72c4a6d2b8444a942123a63bac170..f132e0bc3129810096596ea771bdcf41ed26f171 100644
--- a/ui/views/style/platform_style.h
+++ b/ui/views/style/platform_style.h
@@ -9,18 +9,30 @@
#include "base/memory/scoped_ptr.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/combobox/combobox.h"
+#include "ui/views/views_export.h"
namespace views {
class Border;
class FocusableBorder;
+class Label;
class LabelButton;
class LabelButtonBorder;
class ScrollBar;
// Cross-platform API for providing platform-specific styling for toolkit-views.
-class PlatformStyle {
+class VIEWS_EXPORT PlatformStyle {
public:
+ // Type used by LabelButton to map button states to text colors.
+ typedef SkColor ButtonColorByState[Button::STATE_COUNT];
sky 2016/04/07 17:16:31 using?
tapted 2016/04/08 08:35:33 Done.
+
+ // Minimum size for platform-styled buttons (Button::STYLE_BUTTON).
+ static const int kMinLabelButtonWidth;
+ static const int kMinLabelButtonHeight;
+
+ // Whether dialog-default buttons are given a bold font style.
+ static const bool kDefaultLabelButtonHasBoldFont;
+
// Creates an ImageSkia containing the image to use for the combobox arrow.
// The |is_enabled| argument is true if the control the arrow is for is
// enabled, and false if the control is disabled. The |style| argument is the
@@ -39,12 +51,22 @@ class PlatformStyle {
static scoped_ptr<LabelButtonBorder> CreateLabelButtonBorder(
Button::ButtonStyle style);
- // Applies the current system theme to the default border created by |button|.
- static scoped_ptr<Border> CreateThemedLabelButtonBorder(LabelButton* button);
-
// Creates the default scrollbar for the given orientation.
static scoped_ptr<ScrollBar> CreateScrollBar(bool is_horizontal);
+ // Returns the current text color for the current button state.
+ static SkColor TextColorForButton(const ButtonColorByState& color_by_state,
+ const LabelButton& button);
+
+ // Applies platform styles to |label| and fills |color_by_state| with the text
+ // colors for normal, pressed, hovered, and disabled states, if the colors for
+ // Button::STYLE_BUTTON buttons differ from those provided by ui::NativeTheme.
+ static void ApplyLabelButtonTextStyle(Label* label,
+ ButtonColorByState* color_by_state);
+
+ // Applies the current system theme to the default border created by |button|.
+ static scoped_ptr<Border> CreateThemedLabelButtonBorder(LabelButton* button);
+
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(PlatformStyle);
};

Powered by Google App Engine
This is Rietveld 408576698