| 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/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 return; | 581 return; |
| 582 default: | 582 default: |
| 583 break; | 583 break; |
| 584 } | 584 } |
| 585 | 585 |
| 586 View* gesture_handler = NULL; | 586 View* gesture_handler = NULL; |
| 587 if (views::switches::IsRectBasedTargetingEnabled() && | 587 if (views::switches::IsRectBasedTargetingEnabled() && |
| 588 !event->details().bounding_box().IsEmpty()) { | 588 !event->details().bounding_box().IsEmpty()) { |
| 589 // TODO(tdanderson): Pass in the bounding box to GetEventHandlerForRect() | 589 // TODO(tdanderson): Pass in the bounding box to GetEventHandlerForRect() |
| 590 // once crbug.com/313392 is resolved. | 590 // once crbug.com/313392 is resolved. |
| 591 gfx::Rect touch_rect(event->details().bounding_box()); | 591 gfx::RectF touch_rect(event->details().bounding_box()); |
| 592 touch_rect.set_origin(event->location()); | 592 touch_rect.set_origin(event->location()); |
| 593 touch_rect.Offset(-touch_rect.width() / 2, -touch_rect.height() / 2); | 593 touch_rect.Offset(-touch_rect.width() / 2, -touch_rect.height() / 2); |
| 594 gesture_handler = GetEventHandlerForRect(touch_rect); | 594 gesture_handler = GetEventHandlerForRect(touch_rect); |
| 595 } else { | 595 } else { |
| 596 gesture_handler = GetEventHandlerForPoint(event->location()); | 596 gesture_handler = GetEventHandlerForPoint(event->location()); |
| 597 } | 597 } |
| 598 | 598 |
| 599 // Walk up the tree until we find a view that wants the gesture event. | 599 // Walk up the tree until we find a view that wants the gesture event. |
| 600 for (gesture_handler_ = gesture_handler; | 600 for (gesture_handler_ = gesture_handler; |
| 601 gesture_handler_ && (gesture_handler_ != this); | 601 gesture_handler_ && (gesture_handler_ != this); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 | 776 |
| 777 #ifndef NDEBUG | 777 #ifndef NDEBUG |
| 778 DCHECK(!event_dispatch_target_ || Contains(event_dispatch_target_)); | 778 DCHECK(!event_dispatch_target_ || Contains(event_dispatch_target_)); |
| 779 #endif | 779 #endif |
| 780 | 780 |
| 781 return details; | 781 return details; |
| 782 } | 782 } |
| 783 | 783 |
| 784 } // namespace internal | 784 } // namespace internal |
| 785 } // namespace views | 785 } // namespace views |
| OLD | NEW |