OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/widget/root_view.h" | 5 #include "ui/views/widget/root_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 status = scroll_gesture_handler_->ProcessGestureEvent(gesture_event); | 489 status = scroll_gesture_handler_->ProcessGestureEvent(gesture_event); |
490 if (status == ui::GESTURE_STATUS_CONSUMED) | 490 if (status == ui::GESTURE_STATUS_CONSUMED) |
491 return status; | 491 return status; |
492 } | 492 } |
493 scroll_gesture_handler_ = NULL; | 493 scroll_gesture_handler_ = NULL; |
494 } | 494 } |
495 | 495 |
496 return ui::GESTURE_STATUS_UNKNOWN; | 496 return ui::GESTURE_STATUS_UNKNOWN; |
497 } | 497 } |
498 | 498 |
| 499 gfx::Rect touch_rect(event.details().bounding_box()); |
| 500 View *v = GetEventHandlerForRect(touch_rect); |
| 501 |
499 // Walk up the tree until we find a view that wants the gesture event. | 502 // Walk up the tree until we find a view that wants the gesture event. |
500 for (gesture_handler_ = GetEventHandlerForPoint(e.location()); | 503 for (gesture_handler_ = v ? v : GetEventHandlerForPoint(e.location()); |
501 gesture_handler_ && (gesture_handler_ != this); | 504 gesture_handler_ && (gesture_handler_ != this); |
502 gesture_handler_ = gesture_handler_->parent()) { | 505 gesture_handler_ = gesture_handler_->parent()) { |
503 if (!gesture_handler_->enabled()) { | 506 if (!gesture_handler_->enabled()) { |
504 // Disabled views eat events but are treated as not handled. | 507 // Disabled views eat events but are treated as not handled. |
505 return ui::GESTURE_STATUS_UNKNOWN; | 508 return ui::GESTURE_STATUS_UNKNOWN; |
506 } | 509 } |
507 | 510 |
508 // See if this view wants to handle the Gesture. | 511 // See if this view wants to handle the Gesture. |
509 GestureEvent gesture_event(e, this, gesture_handler_); | 512 GestureEvent gesture_event(e, this, gesture_handler_); |
510 status = gesture_handler_->ProcessGestureEvent(gesture_event); | 513 status = gesture_handler_->ProcessGestureEvent(gesture_event); |
511 | 514 |
512 // The view could have removed itself from the tree when handling | 515 // The view could have removed itself from the tree when handling |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 } | 602 } |
600 | 603 |
601 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { | 604 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { |
602 last_mouse_event_flags_ = event.flags(); | 605 last_mouse_event_flags_ = event.flags(); |
603 last_mouse_event_x_ = event.x(); | 606 last_mouse_event_x_ = event.x(); |
604 last_mouse_event_y_ = event.y(); | 607 last_mouse_event_y_ = event.y(); |
605 } | 608 } |
606 | 609 |
607 } // namespace internal | 610 } // namespace internal |
608 } // namespace views | 611 } // namespace views |
OLD | NEW |