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

Unified Diff: ui/views/view_targeter_delegate.cc

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 (nit) 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
« no previous file with comments | « ui/views/view.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_targeter_delegate.cc
diff --git a/ui/views/view_targeter_delegate.cc b/ui/views/view_targeter_delegate.cc
index b20842f120074e04a98aa38af683193cd205e837..7347141dde51980940a3cdebedd65e685e6324f5 100644
--- a/ui/views/view_targeter_delegate.cc
+++ b/ui/views/view_targeter_delegate.cc
@@ -6,6 +6,7 @@
#include <limits.h>
+#include "base/containers/adapters.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/views/rect_based_targeting_utils.h"
#include "ui/views/view.h"
@@ -42,9 +43,9 @@ View* ViewTargeterDelegate::TargetForRect(View* root, const gfx::Rect& rect) {
// from this function call if point-based targeting were used.
View* point_view = NULL;
- for (int i = root->child_count() - 1; i >= 0; --i) {
- View* child = root->child_at(i);
-
+ View::Views children = root->GetChildrenInZOrder();
+ DCHECK_EQ(root->child_count(), static_cast<int>(children.size()));
+ for (auto* child : base::Reversed(children)) {
if (!child->CanProcessEventsWithinSubtree())
continue;
« no previous file with comments | « ui/views/view.cc ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698