| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_NATIVE_THEME_NATIVE_THEME_MAC_H_ | 5 #ifndef UI_NATIVE_THEME_NATIVE_THEME_MAC_H_ |
| 6 #define UI_NATIVE_THEME_NATIVE_THEME_MAC_H_ | 6 #define UI_NATIVE_THEME_NATIVE_THEME_MAC_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/native_theme/native_theme_base.h" | 9 #include "ui/native_theme/native_theme_base.h" |
| 10 #include "ui/native_theme/native_theme_export.h" | 10 #include "ui/native_theme/native_theme_export.h" |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 13 | 13 |
| 14 // Mac implementation of native theme support. | 14 // Mac implementation of native theme support. |
| 15 class NATIVE_THEME_EXPORT NativeThemeMac : public NativeThemeBase { | 15 class NATIVE_THEME_EXPORT NativeThemeMac : public NativeThemeBase { |
| 16 public: | 16 public: |
| 17 static const int kComboboxCornerRadius = 5; | 17 static const int kComboboxCornerRadius = 5; |
| 18 | 18 |
| 19 // Type of gradient to use on a button background. Use HIGHLIGHTED for the |
| 20 // default button of a window and all combobox controls, but only when the |
| 21 // window is active. |
| 22 enum class ButtonBackgroundType { |
| 23 DISABLED, |
| 24 HIGHLIGHTED, |
| 25 NORMAL, |
| 26 PRESSED, |
| 27 COUNT |
| 28 }; |
| 29 |
| 19 static NativeThemeMac* instance(); | 30 static NativeThemeMac* instance(); |
| 20 | 31 |
| 21 // Overridden from NativeTheme: | 32 // Overridden from NativeTheme: |
| 22 SkColor GetSystemColor(ColorId color_id) const override; | 33 SkColor GetSystemColor(ColorId color_id) const override; |
| 23 | 34 |
| 24 // Overridden from NativeThemeBase: | 35 // Overridden from NativeThemeBase: |
| 25 void PaintMenuPopupBackground( | 36 void PaintMenuPopupBackground( |
| 26 SkCanvas* canvas, | 37 SkCanvas* canvas, |
| 27 const gfx::Size& size, | 38 const gfx::Size& size, |
| 28 const MenuBackgroundExtraParams& menu_background) const override; | 39 const MenuBackgroundExtraParams& menu_background) const override; |
| 29 void PaintMenuItemBackground( | 40 void PaintMenuItemBackground( |
| 30 SkCanvas* canvas, | 41 SkCanvas* canvas, |
| 31 State state, | 42 State state, |
| 32 const gfx::Rect& rect, | 43 const gfx::Rect& rect, |
| 33 const MenuItemExtraParams& menu_item) const override; | 44 const MenuItemExtraParams& menu_item) const override; |
| 34 | 45 |
| 35 // Creates a shader appropriate for painting the background of a button. | 46 // Creates a shader appropriate for painting the background of a button. |
| 36 static sk_sp<SkShader> GetButtonBackgroundShader(State state, int height); | 47 static sk_sp<SkShader> GetButtonBackgroundShader(ButtonBackgroundType type, |
| 48 int height); |
| 37 | 49 |
| 38 private: | 50 private: |
| 39 NativeThemeMac(); | 51 NativeThemeMac(); |
| 40 ~NativeThemeMac() override; | 52 ~NativeThemeMac() override; |
| 41 | 53 |
| 42 DISALLOW_COPY_AND_ASSIGN(NativeThemeMac); | 54 DISALLOW_COPY_AND_ASSIGN(NativeThemeMac); |
| 43 }; | 55 }; |
| 44 | 56 |
| 45 } // namespace ui | 57 } // namespace ui |
| 46 | 58 |
| 47 #endif // UI_NATIVE_THEME_NATIVE_THEME_MAC_H_ | 59 #endif // UI_NATIVE_THEME_NATIVE_THEME_MAC_H_ |
| OLD | NEW |