OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GFX_SYS_COLOR_CHANGE_LISTENER_H_ | 5 #ifndef UI_GFX_SYS_COLOR_CHANGE_LISTENER_H_ |
6 #define UI_GFX_SYS_COLOR_CHANGE_LISTENER_H_ | 6 #define UI_GFX_SYS_COLOR_CHANGE_LISTENER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
10 #include "ui/gfx/gfx_export.h" | 10 #include "ui/gfx/gfx_export.h" |
11 | 11 |
12 namespace gfx { | 12 namespace gfx { |
13 | 13 |
14 // Returns true only if Chrome should use an inverted color scheme - which is | 14 // Returns true only if Chrome should use an inverted color scheme - which is |
15 // only true if the system has high-contrast mode enabled and and is using a | 15 // only true if the system has high-contrast mode enabled and and is using a |
16 // light-on-dark color scheme. To be notified when this status changes, use | 16 // light-on-dark color scheme. To be notified when this status changes, use |
17 // ScopedSysColorChangeListener, below. | 17 // ScopedSysColorChangeListener, below. |
18 UI_EXPORT bool IsInvertedColorScheme(); | 18 GFX_EXPORT bool IsInvertedColorScheme(); |
19 | 19 |
20 // Interface for classes that want to listen to system color changes. | 20 // Interface for classes that want to listen to system color changes. |
21 class UI_EXPORT SysColorChangeListener { | 21 class GFX_EXPORT SysColorChangeListener { |
22 public: | 22 public: |
23 virtual void OnSysColorChange() = 0; | 23 virtual void OnSysColorChange() = 0; |
24 | 24 |
25 protected: | 25 protected: |
26 virtual ~SysColorChangeListener() {} | 26 virtual ~SysColorChangeListener() {} |
27 }; | 27 }; |
28 | 28 |
29 // Create an instance of this class in any object that wants to listen | 29 // Create an instance of this class in any object that wants to listen |
30 // for system color changes. | 30 // for system color changes. |
31 class UI_EXPORT ScopedSysColorChangeListener { | 31 class GFX_EXPORT ScopedSysColorChangeListener { |
32 public: | 32 public: |
33 explicit ScopedSysColorChangeListener(SysColorChangeListener* listener); | 33 explicit ScopedSysColorChangeListener(SysColorChangeListener* listener); |
34 ~ScopedSysColorChangeListener(); | 34 ~ScopedSysColorChangeListener(); |
35 | 35 |
36 private: | 36 private: |
37 SysColorChangeListener* listener_; | 37 SysColorChangeListener* listener_; |
38 | 38 |
39 DISALLOW_COPY_AND_ASSIGN(ScopedSysColorChangeListener); | 39 DISALLOW_COPY_AND_ASSIGN(ScopedSysColorChangeListener); |
40 }; | 40 }; |
41 | 41 |
42 } // namespace gfx; | 42 } // namespace gfx; |
43 | 43 |
44 #endif // UI_GFX_SYS_COLOR_CHANGE_LISTENER_H_ | 44 #endif // UI_GFX_SYS_COLOR_CHANGE_LISTENER_H_ |
OLD | NEW |