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

Unified Diff: ui/gfx/native_theme.h

Issue 8597015: Add a new GetSystemColor method to native theme. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win build Created 9 years, 1 month 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 | « no previous file | ui/gfx/native_theme_base.h » ('j') | ui/gfx/native_theme_base.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/native_theme.h
diff --git a/ui/gfx/native_theme.h b/ui/gfx/native_theme.h
index cc9aa35e4049bcdb8eabadaa4158b330415a96f0..f561e30d9093dd1576a29e5dff148aae2ce64fff 100644
--- a/ui/gfx/native_theme.h
+++ b/ui/gfx/native_theme.h
@@ -19,11 +19,13 @@ class Size;
// This class supports drawing UI controls (like buttons, text fields, lists,
// comboboxes, etc) that look like the native UI controls of the underlying
-// platform, such as Windows or Linux.
+// platform, such as Windows or Linux. It also supplies default colors for
+// dialog box backgrounds, etc., which are obtained from the system theme where
+// possible.
//
// The supported control types are listed in the Part enum. These parts can be
-// in any state given by the State enum, where the actual definititon of the
-// state is part-specific.
+// in any state given by the State enum, where the actual definition of the
+// state is part-specific. The supported colors are listed in the ColorId enum.
//
// Some parts require more information than simply the state in order to be
// drawn correctly, and this information is given to the Paint() method via the
@@ -212,6 +214,15 @@ class UI_EXPORT NativeTheme {
unsigned active_color,
unsigned track_color) const;
+ // Colors for GetSystemColor().
+ enum ColorId {
+ kDialogBackgroundColorId
Ben Goodger (Google) 2011/11/21 18:59:59 OCD requires me to suggest putting the constant pa
benrg 2011/11/21 19:54:20 Done.
+ // TODO(benrg): move other hardcoded colors here.
+ };
+
+ // Return a color from the system theme.
+ virtual SkColor GetSystemColor(ColorId color_id) const = 0;
+
// Returns a shared instance of the native theme.
// The returned object should not be deleted by the caller. This function
// is not thread safe and should only be called from the UI thread.
« no previous file with comments | « no previous file | ui/gfx/native_theme_base.h » ('j') | ui/gfx/native_theme_base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698