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

Unified Diff: ui/views/view.cc

Issue 297963006: Introduce View::CanProcessEventsWithinSubtree() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 6 years, 7 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.h ('k') | ui/views/view_targeter.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 955ad2482d25ba893528f1db1ac3d3bd56e70910..3d902a6487fb939c2f0bd437a5215d4701034f6e 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -849,6 +849,9 @@ View* View::GetEventHandlerForRect(const gfx::Rect& rect) {
for (int i = child_count() - 1; i >= 0; --i) {
View* child = child_at(i);
+ if (!child->CanProcessEventsWithinSubtree())
+ continue;
+
// Ignore any children which are invisible or do not intersect |rect|.
if (!child->visible())
continue;
@@ -904,6 +907,10 @@ View* View::GetEventHandlerForRect(const gfx::Rect& rect) {
return rect_view ? rect_view : point_view;
}
+bool View::CanProcessEventsWithinSubtree() const {
+ return true;
+}
+
View* View::GetTooltipHandlerForPoint(const gfx::Point& point) {
if (!HitTestPoint(point))
return NULL;
@@ -915,6 +922,9 @@ View* View::GetTooltipHandlerForPoint(const gfx::Point& point) {
if (!child->visible())
continue;
+ if (!child->CanProcessEventsWithinSubtree())
+ continue;
+
gfx::Point point_in_child_coords(point);
ConvertPointToTarget(this, child, &point_in_child_coords);
View* handler = child->GetTooltipHandlerForPoint(point_in_child_coords);
« no previous file with comments | « ui/views/view.h ('k') | ui/views/view_targeter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698