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

Unified Diff: ui/views/view.h

Issue 2813353002: Ensure that the focus ring in the bookmarks bar does not paint outside the parent view. (Closed)
Patch Set: Fix test 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.h
diff --git a/ui/views/view.h b/ui/views/view.h
index bfa107c7eb59451d32fd8c211537fb1c21eda3d0..17ec7c369777038ef9cfd05f33516abfe241a53d 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -340,10 +340,23 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Compositor.
void SetPaintToLayer(ui::LayerType layer_type = ui::LAYER_TEXTURED);
+ enum LayerChangeNotifyBehavior {
sky 2017/04/18 23:02:21 enum class
ananta 2017/04/18 23:14:46 Done.
+ // Notify the parent chain about the layer change.
+ NOTIFY,
+ // Don't notify the parent chain about the layer change.
+ DONT_NOTIFY
+ };
+
+ // Please refer to the comments above the DestroyLayerImpl() function for
+ // details.
+ void DestroyLayer();
+
// Destroys the layer associated with this view, and reparents any descendants
// to the destroyed layer's parent. If the view does not currently have a
// layer, this has no effect.
- void DestroyLayer();
+ // The |notify_parents| enum controls whether a notification about the layer
+ // change is sent to the parents.
+ void DestroyLayerImpl(LayerChangeNotifyBehavior notify_parents);
sky 2017/04/18 23:02:21 Move this (and enum) to the private section in the
ananta 2017/04/18 23:14:46 Done.
// Overridden from ui::LayerOwner:
std::unique_ptr<ui::Layer> RecreateLayer() override;
@@ -1189,6 +1202,11 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// below layers owned by a view.
virtual void ReorderChildLayers(ui::Layer* parent_layer);
+ // Notifies parents about a layer being created or destroyed in a child. An
+ // example where a subclass may override this method is when it wants to clip
+ // the child by adding its own layer.
+ virtual void OnChildLayerChanged(View* child);
+
// Input ---------------------------------------------------------------------
virtual DragInfo* GetDragInfo();
@@ -1515,6 +1533,10 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
//////////////////////////////////////////////////////////////////////////////
+ // Notifies parents about layering changes in the view. This includes layer
+ // creation and destruction.
+ void NotifyParentsOfLayerChange();
sky 2017/04/18 23:02:21 Move this to the "Accelerated painting" section ab
+
// Creation and lifetime -----------------------------------------------------
// False if this View is owned by its parent - i.e. it will be deleted by its
« no previous file with comments | « ui/views/controls/scroll_view.cc ('k') | ui/views/view.cc » ('j') | ui/views/view_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698