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 gfx::Point touch_rect_location(touch_rect.x(), touch_rect.y()); | |
501 ConvertPointToScreen(this, &touch_rect_location); | |
502 touch_rect.set_origin(touch_rect_location); | |
503 View *v = GetEventHandlerForRect(touch_rect); | |
504 | |
499 // Walk up the tree until we find a view that wants the gesture event. | 505 // Walk up the tree until we find a view that wants the gesture event. |
500 for (gesture_handler_ = GetEventHandlerForPoint(e.location()); | 506 for (gesture_handler_ = v ? v : GetEventHandlerForPoint(e.location()); |
sky
2012/08/02 15:52:08
Seems wierd to fallback to GetEventHandlerForPoint
tdanderson
2012/08/02 18:11:37
The fallback is the intended behavior since GetEve
| |
501 gesture_handler_ && (gesture_handler_ != this); | 507 gesture_handler_ && (gesture_handler_ != this); |
502 gesture_handler_ = gesture_handler_->parent()) { | 508 gesture_handler_ = gesture_handler_->parent()) { |
503 if (!gesture_handler_->enabled()) { | 509 if (!gesture_handler_->enabled()) { |
504 // Disabled views eat events but are treated as not handled. | 510 // Disabled views eat events but are treated as not handled. |
505 return ui::GESTURE_STATUS_UNKNOWN; | 511 return ui::GESTURE_STATUS_UNKNOWN; |
506 } | 512 } |
507 | 513 |
508 // See if this view wants to handle the Gesture. | 514 // See if this view wants to handle the Gesture. |
509 GestureEvent gesture_event(e, this, gesture_handler_); | 515 GestureEvent gesture_event(e, this, gesture_handler_); |
510 status = gesture_handler_->ProcessGestureEvent(gesture_event); | 516 status = gesture_handler_->ProcessGestureEvent(gesture_event); |
511 | 517 |
512 // The view could have removed itself from the tree when handling | 518 // 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 } | 605 } |
600 | 606 |
601 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { | 607 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { |
602 last_mouse_event_flags_ = event.flags(); | 608 last_mouse_event_flags_ = event.flags(); |
603 last_mouse_event_x_ = event.x(); | 609 last_mouse_event_x_ = event.x(); |
604 last_mouse_event_y_ = event.y(); | 610 last_mouse_event_y_ = event.y(); |
605 } | 611 } |
606 | 612 |
607 } // namespace internal | 613 } // namespace internal |
608 } // namespace views | 614 } // namespace views |
OLD | NEW |