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

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

Issue 1138993007: Substituting pattern push_back(ptr.release()) with push_back(ptr.Pass()) in ui/events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated the review comments Created 5 years, 6 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 "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/events/gesture_detection/gesture_configuration.h" 10 #include "ui/events/gesture_detection/gesture_configuration.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 gesture.y, 69 gesture.y,
70 gesture.flags, 70 gesture.flags,
71 gesture.time - base::TimeTicks(), 71 gesture.time - base::TimeTicks(),
72 details)); 72 details));
73 73
74 if (!handling_event_) { 74 if (!handling_event_) {
75 // Dispatching event caused by timer. 75 // Dispatching event caused by timer.
76 client_->OnGestureEvent(event.get()); 76 client_->OnGestureEvent(event.get());
77 } else { 77 } else {
78 // Memory managed by ScopedVector pending_gestures_. 78 // Memory managed by ScopedVector pending_gestures_.
79 pending_gestures_.push_back(event.release()); 79 pending_gestures_.push_back(event.Pass());
80 } 80 }
81 } 81 }
82 82
83 ScopedVector<GestureEvent>* GestureProviderAura::GetAndResetPendingGestures() { 83 ScopedVector<GestureEvent>* GestureProviderAura::GetAndResetPendingGestures() {
84 if (pending_gestures_.empty()) 84 if (pending_gestures_.empty())
85 return NULL; 85 return NULL;
86 // Caller is responsible for deleting old_pending_gestures. 86 // Caller is responsible for deleting old_pending_gestures.
87 ScopedVector<GestureEvent>* old_pending_gestures = 87 ScopedVector<GestureEvent>* old_pending_gestures =
88 new ScopedVector<GestureEvent>(); 88 new ScopedVector<GestureEvent>();
89 old_pending_gestures->swap(pending_gestures_); 89 old_pending_gestures->swap(pending_gestures_);
(...skipping 13 matching lines...) Expand all
103 float double_tap_slop_square = 103 float double_tap_slop_square =
104 GestureConfiguration::GetInstance() 104 GestureConfiguration::GetInstance()
105 ->max_distance_between_taps_for_double_tap(); 105 ->max_distance_between_taps_for_double_tap();
106 double_tap_slop_square *= double_tap_slop_square; 106 double_tap_slop_square *= double_tap_slop_square;
107 const float delta_x = previous_tap.x - current_tap.x; 107 const float delta_x = previous_tap.x - current_tap.x;
108 const float delta_y = previous_tap.y - current_tap.y; 108 const float delta_y = previous_tap.y - current_tap.y;
109 return (delta_x * delta_x + delta_y * delta_y < double_tap_slop_square); 109 return (delta_x * delta_x + delta_y * delta_y < double_tap_slop_square);
110 } 110 }
111 111
112 } // namespace content 112 } // namespace content
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/motion_event_generic.cc ('k') | ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698