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

Unified Diff: ui/views/widget/root_view.cc

Issue 542323002: Convert ui::GestureEvent coordinates during targeting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years, 3 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_targeter_unittest.cc ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/root_view.cc
diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc
index 57457aad554901722dd85057affaeee14738b8e5..76125d77ebcf76557f60fc2333ee94f191904377 100644
--- a/ui/views/widget/root_view.cc
+++ b/ui/views/widget/root_view.cc
@@ -647,19 +647,19 @@ View::DragInfo* RootView::GetDragInfo() {
void RootView::DispatchGestureEvent(ui::GestureEvent* event) {
bool gesture_handler_set_before_dispatch = !!gesture_handler_;
- View* target =
- static_cast<View*>(targeter()->FindTargetForEvent(this, event));
+ scoped_ptr<ui::Event> event_copy = ui::Event::Clone(*event);
+ View* target = static_cast<View*>(
+ targeter()->FindTargetForEvent(this, event_copy.get()));
while (target && target != this) {
// Create and dispatch a copy of |event|.
- ui::GestureEvent event_copy(*event, static_cast<View*>(this), target);
ui::EventDispatchDetails dispatch_details =
- DispatchEvent(target, &event_copy);
+ DispatchEvent(target, event_copy.get());
if (dispatch_details.dispatcher_destroyed)
return;
- if (event_copy.stopped_propagation())
+ if (event_copy->stopped_propagation())
event->StopPropagation();
- else if (event_copy.handled())
+ else if (event_copy->handled())
event->SetHandled();
// If the event was handled by the previous dispatch or if the target
@@ -669,7 +669,8 @@ void RootView::DispatchGestureEvent(ui::GestureEvent* event) {
// The event was not handled by |target|, so continue processing by
// re-targeting the event.
- target = static_cast<View*>(targeter()->FindNextBestTarget(target, event));
+ target = static_cast<View*>(
+ targeter()->FindNextBestTarget(target, event_copy.get()));
}
// |event| was not handled, so if |gesture_handler_| was not set by the
« no previous file with comments | « ui/views/view_targeter_unittest.cc ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698