blob: 935ab3fe238bd09af9adc722490fba0c751800ab [file] [log] [blame]
[email protected]b0988b22013-11-08 08:25:581// Copyright 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CONTENT_BROWSER_THEME_HELPER_MAC_H_
6#define CONTENT_BROWSER_THEME_HELPER_MAC_H_
7
8#include "base/memory/singleton.h"
9#include "content/public/browser/notification_observer.h"
10#include "content/public/browser/notification_registrar.h"
[email protected]291857a2014-01-23 17:49:1111#include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h"
[email protected]b0988b22013-11-08 08:25:5812
13namespace content {
14
15class ThemeHelperMac : public NotificationObserver {
16 public:
17 // Return pointer to the singleton instance for the current process, or NULL
18 // if none.
19 static ThemeHelperMac* GetInstance();
20
[email protected]291857a2014-01-23 17:49:1121 // Returns the value of +[NSScroller preferredScrollStyle] as expressed
22 // as the blink enum value.
23 static blink::ScrollerStyle GetPreferredScrollerStyle();
24
[email protected]b0988b22013-11-08 08:25:5825 static void SendThemeChangeToAllRenderers(
26 float initial_button_delay,
27 float autoscroll_button_delay,
28 bool jump_on_track_click,
[email protected]291857a2014-01-23 17:49:1129 blink::ScrollerStyle preferred_scroller_style,
[email protected]b0988b22013-11-08 08:25:5830 bool redraw);
31
32 private:
33 friend struct DefaultSingletonTraits<ThemeHelperMac>;
34
35 ThemeHelperMac();
dchengc2282aa2014-10-21 12:07:5836 ~ThemeHelperMac() override;
[email protected]b0988b22013-11-08 08:25:5837
38 // Overridden from NotificationObserver:
dchengc2282aa2014-10-21 12:07:5839 void Observe(int type,
40 const NotificationSource& source,
41 const NotificationDetails& details) override;
[email protected]b0988b22013-11-08 08:25:5842
43 NotificationRegistrar registrar_;
44
45 DISALLOW_COPY_AND_ASSIGN(ThemeHelperMac);
46};
47
48} // namespace content
49
50#endif // CONTENT_BROWSER_THEME_HELPER_MAC_H_