Chromium Code Reviews| Index: ui/gfx/native_theme.h |
| diff --git a/ui/gfx/native_theme.h b/ui/gfx/native_theme.h |
| index cc9aa35e4049bcdb8eabadaa4158b330415a96f0..4932bbb0682bf15f3f7dae062f7922ae46c59d52 100644 |
| --- a/ui/gfx/native_theme.h |
| +++ b/ui/gfx/native_theme.h |
| @@ -14,16 +14,23 @@ class SkCanvas; |
| namespace gfx { |
| +namespace { |
| +// Returned by GetSystemColor() in response to an invalid ColorId. |
| +const SkColor kColorYouShouldNeverSee = SkColorSetRGB(255, 0, 128); |
|
James Cook
2011/11/19 00:28:14
I wouldn't do this in a header file, even though t
benrg
2011/11/21 18:32:40
It seems silly to add a public method for code tha
|
| +} |
| + |
| class Rect; |
| 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 +219,15 @@ class UI_EXPORT NativeTheme { |
| unsigned active_color, |
| unsigned track_color) const; |
| + // Colors for GetSystemColor(). |
| + enum ColorId { |
| + kDialogBackgroundColorId |
| + // 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. |