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

Unified Diff: ui/views/view.h

Issue 2561253002: [ash-md] Adds support for Z-order iteration in views::View (Closed)
Patch Set: [ash-md] Adds support for Z-order iteration in views::View (rebased) Created 3 years, 12 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 ab258061984d61ffd373069e7e4ad0f2ea8fab85..71b1cd9c27ace30ac6e407754dcb914d9716dd90 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -192,6 +192,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
void RemoveAllChildViews(bool delete_children);
int child_count() const { return static_cast<int>(children_.size()); }
+ // See also |GetChildrenInZOrder()| below that returns |children_|
+ // in reverse z-order.
bool has_children() const { return !children_.empty(); }
// Returns the child view at |index|.
@@ -308,6 +310,14 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Returns whether the view is enabled.
bool enabled() const { return enabled_; }
+ // Returns the child views ordered in reverse z-order. That is, views later in
+ // the returned vector have a higher z-order (are painted later) than those
+ // early in the vector. The returned vector has exactly the same number of
+ // Views as |children_|. The default implementation returns |children_|,
+ // subclass if the paint order should differ from that of |children_|.
+ // This order is taken into account by painting and targeting implementations.
+ virtual View::Views GetChildrenInZOrder();
+
// Transformations -----------------------------------------------------------
// Methods for setting transformations for a view (e.g. rotation, scaling).

Powered by Google App Engine
This is Rietveld 408576698