OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CONTENT_BROWSER_THEME_HELPER_MAC_H_ | 5 #ifndef CONTENT_BROWSER_THEME_HELPER_MAC_H_ |
6 #define CONTENT_BROWSER_THEME_HELPER_MAC_H_ | 6 #define CONTENT_BROWSER_THEME_HELPER_MAC_H_ |
7 | 7 |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
| 11 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 | 14 |
14 class ThemeHelperMac : public NotificationObserver { | 15 class ThemeHelperMac : public NotificationObserver { |
15 public: | 16 public: |
16 // Return pointer to the singleton instance for the current process, or NULL | 17 // Return pointer to the singleton instance for the current process, or NULL |
17 // if none. | 18 // if none. |
18 static ThemeHelperMac* GetInstance(); | 19 static ThemeHelperMac* GetInstance(); |
19 | 20 |
| 21 // Returns the value of +[NSScroller preferredScrollStyle] as expressed |
| 22 // as the blink enum value. |
| 23 static blink::ScrollerStyle GetPreferredScrollerStyle(); |
| 24 |
20 static void SendThemeChangeToAllRenderers( | 25 static void SendThemeChangeToAllRenderers( |
21 float initial_button_delay, | 26 float initial_button_delay, |
22 float autoscroll_button_delay, | 27 float autoscroll_button_delay, |
23 bool jump_on_track_click, | 28 bool jump_on_track_click, |
| 29 blink::ScrollerStyle preferred_scroller_style, |
24 bool redraw); | 30 bool redraw); |
25 | 31 |
26 private: | 32 private: |
27 friend struct DefaultSingletonTraits<ThemeHelperMac>; | 33 friend struct DefaultSingletonTraits<ThemeHelperMac>; |
28 | 34 |
29 ThemeHelperMac(); | 35 ThemeHelperMac(); |
30 virtual ~ThemeHelperMac(); | 36 virtual ~ThemeHelperMac(); |
31 | 37 |
32 // Overridden from NotificationObserver: | 38 // Overridden from NotificationObserver: |
33 virtual void Observe(int type, | 39 virtual void Observe(int type, |
34 const NotificationSource& source, | 40 const NotificationSource& source, |
35 const NotificationDetails& details) OVERRIDE; | 41 const NotificationDetails& details) OVERRIDE; |
36 | 42 |
37 NotificationRegistrar registrar_; | 43 NotificationRegistrar registrar_; |
38 | 44 |
39 DISALLOW_COPY_AND_ASSIGN(ThemeHelperMac); | 45 DISALLOW_COPY_AND_ASSIGN(ThemeHelperMac); |
40 }; | 46 }; |
41 | 47 |
42 } // namespace content | 48 } // namespace content |
43 | 49 |
44 #endif // CONTENT_BROWSER_THEME_HELPER_MAC_H_ | 50 #endif // CONTENT_BROWSER_THEME_HELPER_MAC_H_ |
OLD | NEW |