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

Unified Diff: ui/views/view.h

Issue 2613343002: Allow a View to specify a non-default native theme (i.e. different from (Closed)
Patch Set: no "override" Created 3 years, 11 months 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 | « chrome/browser/ui/views/infobars/confirm_infobar.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.h
diff --git a/ui/views/view.h b/ui/views/view.h
index 21daecf973235757f1252ccbf21d88aca4756cf3..147785c6a86b255dc5e279a35c33d7bb0b7aa76b 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_| 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 and informs descendants.
+ void SetNativeTheme(ui::NativeTheme* theme);
+
// RTL painting --------------------------------------------------------------
// This method determines whether the gfx::Canvas object passed to
@@ -1547,6 +1551,13 @@ 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 native theme for this view and its descendants. Typically null, in which
+ // case the native theme is drawn from the parent view (eventually the
+ // widget).
+ ui::NativeTheme* native_theme_ = nullptr;
+
// RTL painting --------------------------------------------------------------
// Indicates whether or not the gfx::Canvas object passed to View::Paint()
« no previous file with comments | « chrome/browser/ui/views/infobars/confirm_infobar.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698