Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Unified Diff: ui/native_theme/native_theme_win.h

Issue 11421204: Use native theme colors for textfields; etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase, add a blank line between includes. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/native_theme/native_theme_aura.cc ('k') | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/native_theme_win.h
diff --git a/ui/native_theme/native_theme_win.h b/ui/native_theme/native_theme_win.h
index 1e83d1565bb17a9d0652dc4cd0b0bfb3295271bf..d4bdea7ddf18d1b704eaf16e2196603e243b847e 100644
--- a/ui/native_theme/native_theme_win.h
+++ b/ui/native_theme/native_theme_win.h
@@ -11,6 +11,8 @@
// For more information on visual style parts and states, see:
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/userex/topics/partsandstates.asp
+#include <map>
+
#include <windows.h>
#include <uxtheme.h>
@@ -18,6 +20,7 @@
#include "base/compiler_specific.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/size.h"
+#include "ui/gfx/sys_color_change_listener.h"
#include "ui/native_theme/native_theme.h"
class SkCanvas;
@@ -30,7 +33,8 @@ namespace ui {
// of several PaintXXX methods to an API, inherited from the NativeTheme base
// class, that consists of a single Paint() method with a argument to indicate
// what kind of part to paint.
-class NATIVE_THEME_EXPORT NativeThemeWin : public NativeTheme {
+class NATIVE_THEME_EXPORT NativeThemeWin : public NativeTheme,
+ public gfx::SysColorChangeListener {
public:
enum ThemeName {
BUTTON,
@@ -96,7 +100,7 @@ class NATIVE_THEME_EXPORT NativeThemeWin : public NativeTheme {
bool fill_content_area,
bool draw_edges) const;
- // NativeTheme Implementation:
+ // NativeTheme implementation:
virtual gfx::Size GetPartSize(Part part,
State state,
const ExtraParams& extra) const OVERRIDE;
@@ -111,6 +115,12 @@ class NATIVE_THEME_EXPORT NativeThemeWin : public NativeTheme {
NativeThemeWin();
~NativeThemeWin();
+ // gfx::SysColorChangeListener implementation:
+ virtual void OnSysColorChange() OVERRIDE;
+
+ // Update the locally cached set of system colors.
+ void UpdateSystemColors();
+
// Paint directly to canvas' HDC.
void PaintDirect(SkCanvas* canvas,
Part part,
@@ -332,6 +342,10 @@ class NATIVE_THEME_EXPORT NativeThemeWin : public NativeTheme {
// A cache of open theme handles.
mutable HANDLE theme_handles_[LAST];
+ // The system color change listener and the updated cache of system colors.
+ gfx::ScopedSysColorChangeListener color_change_listener_;
+ mutable std::map<int, SkColor> system_colors_;
+
DISALLOW_COPY_AND_ASSIGN(NativeThemeWin);
};
« no previous file with comments | « ui/native_theme/native_theme_aura.cc ('k') | ui/native_theme/native_theme_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698