summaryrefslogtreecommitdiff
path: root/chromium/content/browser/theme_helper_mac.h
blob: 644b37b5b2d018e35fc035ce92df2c71663d6fad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_BROWSER_THEME_HELPER_MAC_H_
#define CONTENT_BROWSER_THEME_HELPER_MAC_H_

#include "base/macros.h"
#include "base/memory/singleton.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "third_party/blink/public/platform/mac/web_scrollbar_theme.h"

namespace content {

class ThemeHelperMac : public NotificationObserver {
 public:
  // Return pointer to the singleton instance for the current process, or NULL
  // if none.
  static ThemeHelperMac* GetInstance();

  // Returns the value of +[NSScroller preferredScrollStyle] as expressed
  // as the blink enum value.
  static blink::ScrollerStyle GetPreferredScrollerStyle();

 private:
  friend struct base::DefaultSingletonTraits<ThemeHelperMac>;

  ThemeHelperMac();
  ~ThemeHelperMac() override;

  // Overridden from NotificationObserver:
  void Observe(int type,
               const NotificationSource& source,
               const NotificationDetails& details) override;

  NotificationRegistrar registrar_;

  DISALLOW_COPY_AND_ASSIGN(ThemeHelperMac);
};

}  // namespace content

#endif  // CONTENT_BROWSER_THEME_HELPER_MAC_H_