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

Side by Side Diff: ui/native_theme/native_theme_mac.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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/native_theme/native_theme_mac.mm » ('j') | ui/native_theme/native_theme_mac.mm » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 BackgroundType { DISABLED, HIGHLIGHTED, NORMAL, PRESSED, COUNT };
sky 2016/04/07 17:16:31 BackgroundType is rather vague. These constants se
tapted 2016/04/08 08:35:33 Done.
23
19 static NativeThemeMac* instance(); 24 static NativeThemeMac* instance();
20 25
21 // Overridden from NativeTheme: 26 // Overridden from NativeTheme:
22 SkColor GetSystemColor(ColorId color_id) const override; 27 SkColor GetSystemColor(ColorId color_id) const override;
23 28
24 // Overridden from NativeThemeBase: 29 // Overridden from NativeThemeBase:
25 void PaintMenuPopupBackground( 30 void PaintMenuPopupBackground(
26 SkCanvas* canvas, 31 SkCanvas* canvas,
27 const gfx::Size& size, 32 const gfx::Size& size,
28 const MenuBackgroundExtraParams& menu_background) const override; 33 const MenuBackgroundExtraParams& menu_background) const override;
29 void PaintMenuItemBackground( 34 void PaintMenuItemBackground(
30 SkCanvas* canvas, 35 SkCanvas* canvas,
31 State state, 36 State state,
32 const gfx::Rect& rect, 37 const gfx::Rect& rect,
33 const MenuItemExtraParams& menu_item) const override; 38 const MenuItemExtraParams& menu_item) const override;
34 39
35 // Creates a shader appropriate for painting the background of a button. 40 // Creates a shader appropriate for painting the background of a button.
36 static sk_sp<SkShader> GetButtonBackgroundShader(State state, int height); 41 static sk_sp<SkShader> GetButtonBackgroundShader(BackgroundType type,
42 int height);
37 43
38 private: 44 private:
39 NativeThemeMac(); 45 NativeThemeMac();
40 ~NativeThemeMac() override; 46 ~NativeThemeMac() override;
41 47
42 DISALLOW_COPY_AND_ASSIGN(NativeThemeMac); 48 DISALLOW_COPY_AND_ASSIGN(NativeThemeMac);
43 }; 49 };
44 50
45 } // namespace ui 51 } // namespace ui
46 52
47 #endif // UI_NATIVE_THEME_NATIVE_THEME_MAC_H_ 53 #endif // UI_NATIVE_THEME_NATIVE_THEME_MAC_H_
OLDNEW
« no previous file with comments | « no previous file | ui/native_theme/native_theme_mac.mm » ('j') | ui/native_theme/native_theme_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698