Chromium Code Reviews| Index: ui/views/view.h |
| diff --git a/ui/views/view.h b/ui/views/view.h |
| index 21daecf973235757f1252ccbf21d88aca4756cf3..94a1efad7a8594b3e7f3fa2c2234537d4ab8ab20 100644 |
| --- a/ui/views/view.h |
| +++ b/ui/views/view.h |
| @@ -539,14 +539,18 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, |
| // Returns the NativeTheme to use for this View. This calls through to |
| // GetNativeTheme() on the Widget this View is in, or provides a default |
| - // theme if there's no widget. Warning: the default theme might not be |
| - // correct; you should probably override OnNativeThemeChanged(). |
| + // theme if there's no widget, or returns |native_theme_override_| if that's |
| + // set. Warning: the default theme might not be correct; you should probably |
| + // override OnNativeThemeChanged(). |
| ui::NativeTheme* GetNativeTheme() { |
| return const_cast<ui::NativeTheme*>( |
| const_cast<const View*>(this)->GetNativeTheme()); |
| } |
| const ui::NativeTheme* GetNativeTheme() const; |
| + // Sets the native theme override and informs descendants. |
|
sky
2017/01/09 16:13:52
I'm not sure 'override' buys much here. How about
Evan Stade
2017/01/09 17:36:26
Done.
|
| + void SetNativeThemeOverride(ui::NativeTheme* theme); |
| + |
| // RTL painting -------------------------------------------------------------- |
| // This method determines whether the gfx::Canvas object passed to |
| @@ -1547,6 +1551,12 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, |
| // Cached output of painting to be reused in future frames until invalidated. |
| ui::PaintCache paint_cache_; |
| + // Native theme -------------------------------------------------------------- |
| + |
| + // A non-default native theme for this view and its descendants. When null, |
| + // the native theme is drawn from the parent view (eventually the widget). |
| + ui::NativeTheme* native_theme_override_ = nullptr; |
| + |
| // RTL painting -------------------------------------------------------------- |
| // Indicates whether or not the gfx::Canvas object passed to View::Paint() |