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

Side by Side Diff: ui/events/gestures/gesture_provider_aura.cc

Issue 1987343002: Drag and drop cleans up touch sequences from the source window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/events/gestures/gesture_provider_aura.h" 5 #include "ui/events/gestures/gesture_provider_aura.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "ui/events/event.h" 11 #include "ui/events/event.h"
12 #include "ui/events/event_utils.h"
12 #include "ui/events/gesture_detection/gesture_configuration.h" 13 #include "ui/events/gesture_detection/gesture_configuration.h"
13 #include "ui/events/gesture_detection/gesture_event_data.h" 14 #include "ui/events/gesture_detection/gesture_event_data.h"
14 #include "ui/events/gesture_detection/gesture_provider_config_helper.h" 15 #include "ui/events/gesture_detection/gesture_provider_config_helper.h"
15 16
16 namespace ui { 17 namespace ui {
17 18
18 GestureProviderAura::GestureProviderAura(GestureConsumer* consumer, 19 GestureProviderAura::GestureProviderAura(GestureConsumer* consumer,
19 GestureProviderAuraClient* client) 20 GestureProviderAuraClient* client)
20 : client_(client), 21 : client_(client),
21 filtered_gesture_provider_( 22 filtered_gesture_provider_(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 ScopedVector<GestureEvent>* GestureProviderAura::GetAndResetPendingGestures() { 68 ScopedVector<GestureEvent>* GestureProviderAura::GetAndResetPendingGestures() {
68 if (pending_gestures_.empty()) 69 if (pending_gestures_.empty())
69 return NULL; 70 return NULL;
70 // Caller is responsible for deleting old_pending_gestures. 71 // Caller is responsible for deleting old_pending_gestures.
71 ScopedVector<GestureEvent>* old_pending_gestures = 72 ScopedVector<GestureEvent>* old_pending_gestures =
72 new ScopedVector<GestureEvent>(); 73 new ScopedVector<GestureEvent>();
73 old_pending_gestures->swap(pending_gestures_); 74 old_pending_gestures->swap(pending_gestures_);
74 return old_pending_gestures; 75 return old_pending_gestures;
75 } 76 }
76 77
78 void GestureProviderAura::OnTouchEnter(int pointer_id, float x, float y) {
79 std::unique_ptr<TouchEvent> touch_event(new TouchEvent(
80 ET_TOUCH_PRESSED, gfx::Point(), EF_IS_SYNTHESIZED, pointer_id,
81 ui::EventTimeForNow(), 0.0f, 0.0f, 0.0f, 0.0f));
82 gfx::PointF point(x, y);
83 touch_event->set_location_f(point);
84 touch_event->set_root_location_f(point);
85
86 OnTouchEvent(touch_event.get());
87 OnTouchEventAck(touch_event->unique_event_id(), true);
88 }
89
77 } // namespace content 90 } // namespace content
OLDNEW
« no previous file with comments | « ui/events/gestures/gesture_provider_aura.h ('k') | ui/events/gestures/gesture_provider_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698