summaryrefslogtreecommitdiff
path: root/chromium/ui/gfx/sys_color_change_listener.h
blob: 7030a043f8b5af77ea297b61e0348f216ece1c4e (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
// Copyright (c) 2012 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 UI_GFX_SYS_COLOR_CHANGE_LISTENER_H_
#define UI_GFX_SYS_COLOR_CHANGE_LISTENER_H_

#include "base/macros.h"
#include "ui/gfx/gfx_export.h"

namespace gfx {

// Interface for classes that want to listen to system color changes.
class GFX_EXPORT SysColorChangeListener {
 public:
  virtual void OnSysColorChange() = 0;

 protected:
  virtual ~SysColorChangeListener() {}
};

// Create an instance of this class in any object that wants to listen
// for system color changes.
class GFX_EXPORT ScopedSysColorChangeListener {
 public:
  explicit ScopedSysColorChangeListener(SysColorChangeListener* listener);
  ~ScopedSysColorChangeListener();

 private:
  SysColorChangeListener* listener_;

  DISALLOW_COPY_AND_ASSIGN(ScopedSysColorChangeListener);
};

}  // namespace gfx;

#endif  // UI_GFX_SYS_COLOR_CHANGE_LISTENER_H_