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

Unified Diff: ui/views/view.cc

Issue 2813353002: Ensure that the focus ring in the bookmarks bar does not paint outside the parent view. (Closed)
Patch Set: Remove newline and global variable Created 3 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
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 83192d8c93df41d122c633fa68f89130182ba0cb..050b22a2f15cd0a21338dd920e7f70f8f2d555e3 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -296,6 +296,8 @@ void View::ReorderChildView(View* view, int index) {
ReorderLayers();
}
+void View::OnChildLayerChanged(View* child) {}
+
void View::RemoveChildView(View* view) {
DoRemoveChildView(view, true, true, false, NULL);
}
@@ -540,6 +542,9 @@ void View::SetPaintToLayer(ui::LayerType layer_type) {
DestroyLayer();
sky 2017/04/18 15:35:48 When called from here DestroyLayer() should not ca
ananta 2017/04/18 22:22:39 Done.
CreateLayer(layer_type);
paint_to_layer_ = true;
+
+ // Notify the parent chain about the layer change.
+ NotifyParentsOfLayerChange();
}
void View::DestroyLayer() {
@@ -567,6 +572,9 @@ void View::DestroyLayer() {
SchedulePaint();
+ // Notify the parent chain about the layer change.
+ NotifyParentsOfLayerChange();
+
Widget* widget = GetWidget();
if (widget)
widget->LayerTreeChanged();
@@ -2650,4 +2658,13 @@ bool View::DoDrag(const ui::LocatedEvent& event,
return true;
}
+void View::NotifyParentsOfLayerChange() {
+ // Notify the parent chain about the layer change.
+ View* view_parent = parent();
+ while (view_parent) {
+ view_parent->OnChildLayerChanged(this);
+ view_parent = view_parent->parent();
+ }
+}
+
} // namespace views

Powered by Google App Engine
This is Rietveld 408576698