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

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

Issue 1975533002: Change ui::Event::time_stamp from TimeDelta to TimeTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates 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"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void GestureProviderAura::OnTouchEventAck(uint32_t unique_event_id, 44 void GestureProviderAura::OnTouchEventAck(uint32_t unique_event_id,
45 bool event_consumed) { 45 bool event_consumed) {
46 DCHECK(pending_gestures_.empty()); 46 DCHECK(pending_gestures_.empty());
47 DCHECK(!handling_event_); 47 DCHECK(!handling_event_);
48 base::AutoReset<bool> handling_event(&handling_event_, true); 48 base::AutoReset<bool> handling_event(&handling_event_, true);
49 filtered_gesture_provider_.OnTouchEventAck(unique_event_id, event_consumed); 49 filtered_gesture_provider_.OnTouchEventAck(unique_event_id, event_consumed);
50 } 50 }
51 51
52 void GestureProviderAura::OnGestureEvent( 52 void GestureProviderAura::OnGestureEvent(
53 const GestureEventData& gesture) { 53 const GestureEventData& gesture) {
54 std::unique_ptr<ui::GestureEvent> event( 54 std::unique_ptr<ui::GestureEvent> event(new ui::GestureEvent(
55 new ui::GestureEvent(gesture.x, gesture.y, gesture.flags, 55 gesture.x, gesture.y, gesture.flags, gesture.time, gesture.details));
56 gesture.time - base::TimeTicks(), gesture.details));
57 56
58 if (!handling_event_) { 57 if (!handling_event_) {
59 // Dispatching event caused by timer. 58 // Dispatching event caused by timer.
60 client_->OnGestureEvent(gesture_consumer_, event.get()); 59 client_->OnGestureEvent(gesture_consumer_, event.get());
61 } else { 60 } else {
62 // Memory managed by ScopedVector pending_gestures_. 61 // Memory managed by ScopedVector pending_gestures_.
63 pending_gestures_.push_back(std::move(event)); 62 pending_gestures_.push_back(std::move(event));
64 } 63 }
65 } 64 }
66 65
67 ScopedVector<GestureEvent>* GestureProviderAura::GetAndResetPendingGestures() { 66 ScopedVector<GestureEvent>* GestureProviderAura::GetAndResetPendingGestures() {
68 if (pending_gestures_.empty()) 67 if (pending_gestures_.empty())
69 return NULL; 68 return NULL;
70 // Caller is responsible for deleting old_pending_gestures. 69 // Caller is responsible for deleting old_pending_gestures.
71 ScopedVector<GestureEvent>* old_pending_gestures = 70 ScopedVector<GestureEvent>* old_pending_gestures =
72 new ScopedVector<GestureEvent>(); 71 new ScopedVector<GestureEvent>();
73 old_pending_gestures->swap(pending_gestures_); 72 old_pending_gestures->swap(pending_gestures_);
74 return old_pending_gestures; 73 return old_pending_gestures;
75 } 74 }
76 75
77 } // namespace content 76 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698