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

Side by Side Diff: content/browser/renderer_host/input/touchscreen_tap_suppression_controller.cc

Issue 1609923002: Fix remaining incompatibilities between scoped_ptr and unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/renderer_host/input/touchscreen_tap_suppression_contro ller.h" 5 #include "content/browser/renderer_host/input/touchscreen_tap_suppression_contro ller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/browser/renderer_host/input/gesture_event_queue.h" 9 #include "content/browser/renderer_host/input/gesture_event_queue.h"
10 10
(...skipping 27 matching lines...) Expand all
38 stashed_tap_down_.reset(new GestureEventWithLatencyInfo(event)); 38 stashed_tap_down_.reset(new GestureEventWithLatencyInfo(event));
39 return true; 39 return true;
40 40
41 case WebInputEvent::GestureShowPress: 41 case WebInputEvent::GestureShowPress:
42 if (!stashed_tap_down_) 42 if (!stashed_tap_down_)
43 return false; 43 return false;
44 stashed_show_press_.reset(new GestureEventWithLatencyInfo(event)); 44 stashed_show_press_.reset(new GestureEventWithLatencyInfo(event));
45 return true; 45 return true;
46 46
47 case WebInputEvent::GestureTapUnconfirmed: 47 case WebInputEvent::GestureTapUnconfirmed:
48 return stashed_tap_down_; 48 return !!stashed_tap_down_;
49 49
50 case WebInputEvent::GestureTapCancel: 50 case WebInputEvent::GestureTapCancel:
51 case WebInputEvent::GestureTap: 51 case WebInputEvent::GestureTap:
52 case WebInputEvent::GestureDoubleTap: 52 case WebInputEvent::GestureDoubleTap:
53 return controller_.ShouldSuppressTapEnd(); 53 return controller_.ShouldSuppressTapEnd();
54 54
55 default: 55 default:
56 break; 56 break;
57 } 57 }
58 return false; 58 return false;
59 } 59 }
60 60
61 void TouchscreenTapSuppressionController::DropStashedTapDown() { 61 void TouchscreenTapSuppressionController::DropStashedTapDown() {
62 stashed_tap_down_.reset(); 62 stashed_tap_down_.reset();
63 stashed_show_press_.reset(); 63 stashed_show_press_.reset();
64 } 64 }
65 65
66 void TouchscreenTapSuppressionController::ForwardStashedTapDown() { 66 void TouchscreenTapSuppressionController::ForwardStashedTapDown() {
67 DCHECK(stashed_tap_down_); 67 DCHECK(stashed_tap_down_);
68 ScopedGestureEvent tap_down = std::move(stashed_tap_down_); 68 ScopedGestureEvent tap_down = std::move(stashed_tap_down_);
69 ScopedGestureEvent show_press = std::move(stashed_show_press_); 69 ScopedGestureEvent show_press = std::move(stashed_show_press_);
70 gesture_event_queue_->ForwardGestureEvent(*tap_down); 70 gesture_event_queue_->ForwardGestureEvent(*tap_down);
71 if (show_press) 71 if (show_press)
72 gesture_event_queue_->ForwardGestureEvent(*show_press); 72 gesture_event_queue_->ForwardGestureEvent(*show_press);
73 } 73 }
74 74
75 } // namespace content 75 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698