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
3 // found in the LICENSE file.
5 #ifndef UI_GFX_SYS_COLOR_CHANGE_LISTENER_H_
6 #define UI_GFX_SYS_COLOR_CHANGE_LISTENER_H_
8 #include "base/basictypes.h"
9 #include "third_party/skia/include/core/SkColor.h"
10 #include "ui/gfx/gfx_export.h"
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
16 // light-on-dark color scheme. To be notified when this status changes, use
17 // ScopedSysColorChangeListener, below.
18 GFX_EXPORT bool IsInvertedColorScheme();
20 // Interface for classes that want to listen to system color changes.
21 class GFX_EXPORT SysColorChangeListener {
23 virtual void OnSysColorChange() = 0;
26 virtual ~SysColorChangeListener() {}
29 // Create an instance of this class in any object that wants to listen
30 // for system color changes.
31 class GFX_EXPORT ScopedSysColorChangeListener {
33 explicit ScopedSysColorChangeListener(SysColorChangeListener* listener);
34 ~ScopedSysColorChangeListener();
37 SysColorChangeListener* listener_;
39 DISALLOW_COPY_AND_ASSIGN(ScopedSysColorChangeListener);
44 #endif // UI_GFX_SYS_COLOR_CHANGE_LISTENER_H_