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

Unified Diff: ui/views/view.cc

Issue 258063009: retry r266622: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert Label changes completely Created 6 years, 8 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 | « ui/views/controls/textfield/textfield.cc ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index f4f6f0d577dffded361184822bb4f012f532f88e..2918ee1aa908ae9dc847777214cfe680b8c38149 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -217,8 +217,9 @@ void View::AddChildViewAt(View* view, int index) {
// If |view| has a parent, remove it from its parent.
View* parent = view->parent_;
- const ui::NativeTheme* old_theme = view->GetNativeTheme();
+ ui::NativeTheme* old_theme = NULL;
if (parent) {
+ old_theme = view->GetNativeTheme();
if (parent == this) {
ReorderChildView(view, index);
return;
@@ -233,6 +234,13 @@ void View::AddChildViewAt(View* view, int index) {
view->parent_ = this;
children_.insert(children_.begin() + index, view);
+ views::Widget* widget = GetWidget();
+ if (widget) {
+ const ui::NativeTheme* new_theme = view->GetNativeTheme();
+ if (new_theme != old_theme)
+ view->PropagateNativeThemeChanged(new_theme);
+ }
+
ViewHierarchyChangedDetails details(true, this, view, parent);
for (View* v = this; v; v = v->parent_)
@@ -240,12 +248,8 @@ void View::AddChildViewAt(View* view, int index) {
view->PropagateAddNotifications(details);
UpdateTooltip();
- views::Widget* widget = GetWidget();
if (widget) {
RegisterChildrenForVisibleBoundsNotification(view);
- const ui::NativeTheme* new_theme = widget->GetNativeTheme();
- if (new_theme != old_theme)
- view->PropagateNativeThemeChanged(new_theme);
if (view->visible())
view->SchedulePaint();
}
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698