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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 | 443 |
444 ui::GestureStatus RootView::OnGestureEvent(const GestureEvent& event) { | 444 ui::GestureStatus RootView::OnGestureEvent(const GestureEvent& event) { |
445 GestureEvent e(event, this); | 445 GestureEvent e(event, this); |
446 ui::GestureStatus status = ui::GESTURE_STATUS_UNKNOWN; | 446 ui::GestureStatus status = ui::GESTURE_STATUS_UNKNOWN; |
447 | 447 |
448 if (gesture_handler_) { | 448 if (gesture_handler_) { |
449 // Allow |gesture_handler_| to delete this during processing. | 449 // Allow |gesture_handler_| to delete this during processing. |
450 View* handler = gesture_handler_; | 450 View* handler = gesture_handler_; |
451 GestureEvent handler_event(event, this, gesture_handler_); | 451 GestureEvent handler_event(event, this, gesture_handler_); |
452 // TODO: should only do this for the last touch id that goes up. | 452 // TODO: should only do this for the last touch id that goes up. |
453 if (event.type() == ui::ET_GESTURE_TAP_UP) | 453 if (event.type() == ui::ET_GESTURE_END) |
454 gesture_handler_ = NULL; | 454 gesture_handler_ = NULL; |
455 return handler->OnGestureEvent(handler_event); | 455 return handler->OnGestureEvent(handler_event); |
456 } | 456 } |
457 | 457 |
458 // Walk up the tree until we find a view that wants the gesture event. | 458 // Walk up the tree until we find a view that wants the gesture event. |
459 for (gesture_handler_ = GetEventHandlerForPoint(e.location()); | 459 for (gesture_handler_ = GetEventHandlerForPoint(e.location()); |
460 gesture_handler_ && (gesture_handler_ != this); | 460 gesture_handler_ && (gesture_handler_ != this); |
461 gesture_handler_ = gesture_handler_->parent()) { | 461 gesture_handler_ = gesture_handler_->parent()) { |
462 if (!gesture_handler_->enabled()) { | 462 if (!gesture_handler_->enabled()) { |
463 // Disabled views eat events but are treated as not handled. | 463 // Disabled views eat events but are treated as not handled. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 } | 554 } |
555 | 555 |
556 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { | 556 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { |
557 last_mouse_event_flags_ = event.flags(); | 557 last_mouse_event_flags_ = event.flags(); |
558 last_mouse_event_x_ = event.x(); | 558 last_mouse_event_x_ = event.x(); |
559 last_mouse_event_y_ = event.y(); | 559 last_mouse_event_y_ = event.y(); |
560 } | 560 } |
561 | 561 |
562 } // namespace internal | 562 } // namespace internal |
563 } // namespace views | 563 } // namespace views |
OLD | NEW |