| 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" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // Adjusts an SkColor based on the current system control tint. For example, | 32 // Adjusts an SkColor based on the current system control tint. For example, |
| 33 // if the current tint is "graphite", this function maps the provided value to | 33 // if the current tint is "graphite", this function maps the provided value to |
| 34 // an appropriate gray. | 34 // an appropriate gray. |
| 35 static SkColor ApplySystemControlTint(SkColor color); | 35 static SkColor ApplySystemControlTint(SkColor color); |
| 36 | 36 |
| 37 // Overridden from NativeTheme: | 37 // Overridden from NativeTheme: |
| 38 SkColor GetSystemColor(ColorId color_id) const override; | 38 SkColor GetSystemColor(ColorId color_id) const override; |
| 39 | 39 |
| 40 // Overridden from NativeThemeBase: | 40 // Overridden from NativeThemeBase: |
| 41 void PaintMenuPopupBackground( | 41 void PaintMenuPopupBackground( |
| 42 SkCanvas* canvas, | 42 CdlCanvas* canvas, |
| 43 const gfx::Size& size, | 43 const gfx::Size& size, |
| 44 const MenuBackgroundExtraParams& menu_background) const override; | 44 const MenuBackgroundExtraParams& menu_background) const override; |
| 45 void PaintMenuItemBackground( | 45 void PaintMenuItemBackground( |
| 46 SkCanvas* canvas, | 46 CdlCanvas* canvas, |
| 47 State state, | 47 State state, |
| 48 const gfx::Rect& rect, | 48 const gfx::Rect& rect, |
| 49 const MenuItemExtraParams& menu_item) const override; | 49 const MenuItemExtraParams& menu_item) const override; |
| 50 | 50 |
| 51 // Creates a shader appropriate for painting the background of a button. | 51 // Creates a shader appropriate for painting the background of a button. |
| 52 static sk_sp<SkShader> GetButtonBackgroundShader(ButtonBackgroundType type, | 52 static sk_sp<SkShader> GetButtonBackgroundShader(ButtonBackgroundType type, |
| 53 int height); | 53 int height); |
| 54 | 54 |
| 55 // Creates a shader for the button border. This should be painted over with | 55 // Creates a shader for the button border. This should be painted over with |
| 56 // the background after insetting the rounded rect. | 56 // the background after insetting the rounded rect. |
| 57 static sk_sp<SkShader> GetButtonBorderShader(ButtonBackgroundType type, | 57 static sk_sp<SkShader> GetButtonBorderShader(ButtonBackgroundType type, |
| 58 int height); | 58 int height); |
| 59 | 59 |
| 60 // Paints the styled button shape used for default controls on Mac. The basic | 60 // Paints the styled button shape used for default controls on Mac. The basic |
| 61 // style is used for dialog buttons, comboboxes, and tabbed pane tabs. | 61 // style is used for dialog buttons, comboboxes, and tabbed pane tabs. |
| 62 // Depending on the control part being drawn, the left or the right side can | 62 // Depending on the control part being drawn, the left or the right side can |
| 63 // be given rounded corners. | 63 // be given rounded corners. |
| 64 static void PaintStyledGradientButton(SkCanvas* canvas, | 64 static void PaintStyledGradientButton(CdlCanvas* canvas, |
| 65 const gfx::Rect& bounds, | 65 const gfx::Rect& bounds, |
| 66 ButtonBackgroundType type, | 66 ButtonBackgroundType type, |
| 67 bool round_left, | 67 bool round_left, |
| 68 bool round_right, | 68 bool round_right, |
| 69 bool focus); | 69 bool focus); |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 NativeThemeMac(); | 72 NativeThemeMac(); |
| 73 ~NativeThemeMac() override; | 73 ~NativeThemeMac() override; |
| 74 | 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(NativeThemeMac); | 75 DISALLOW_COPY_AND_ASSIGN(NativeThemeMac); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 } // namespace ui | 78 } // namespace ui |
| 79 | 79 |
| 80 #endif // UI_NATIVE_THEME_NATIVE_THEME_MAC_H_ | 80 #endif // UI_NATIVE_THEME_NATIVE_THEME_MAC_H_ |
| OLD | NEW |