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

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

Issue 628763003: Support InputRouter recycling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates Created 6 years, 2 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/tap_suppression_controller.h" 5 #include "content/browser/renderer_host/input/tap_suppression_controller.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/browser/renderer_host/input/tap_suppression_controller_client. h" 9 #include "content/browser/renderer_host/input/tap_suppression_controller_client. h"
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 state_ = NOTHING; 104 state_ = NOTHING;
105 StopTapDownTimer(); 105 StopTapDownTimer();
106 client_->DropStashedTapDown(); 106 client_->DropStashedTapDown();
107 return true; 107 return true;
108 case LAST_CANCEL_STOPPED_FLING: 108 case LAST_CANCEL_STOPPED_FLING:
109 NOTREACHED() << "Invalid tap end on LAST_CANCEL_STOPPED_FLING state"; 109 NOTREACHED() << "Invalid tap end on LAST_CANCEL_STOPPED_FLING state";
110 } 110 }
111 return false; 111 return false;
112 } 112 }
113 113
114 void TapSuppressionController::Reset() {
115 if (state_ == DISABLED)
116 return;
117 tap_down_timer_.Stop();
118 if (state_ == TAP_DOWN_STASHED)
119 client_->DropStashedTapDown();
120 state_ = NOTHING;
121 }
122
114 base::TimeTicks TapSuppressionController::Now() { 123 base::TimeTicks TapSuppressionController::Now() {
115 return base::TimeTicks::Now(); 124 return base::TimeTicks::Now();
116 } 125 }
117 126
118 void TapSuppressionController::StartTapDownTimer(const base::TimeDelta& delay) { 127 void TapSuppressionController::StartTapDownTimer(const base::TimeDelta& delay) {
119 tap_down_timer_.Start(FROM_HERE, delay, this, 128 tap_down_timer_.Start(FROM_HERE, delay, this,
120 &TapSuppressionController::TapDownTimerExpired); 129 &TapSuppressionController::TapDownTimerExpired);
121 } 130 }
122 131
123 void TapSuppressionController::StopTapDownTimer() { 132 void TapSuppressionController::StopTapDownTimer() {
(...skipping 14 matching lines...) Expand all
138 case TAP_DOWN_STASHED: 147 case TAP_DOWN_STASHED:
139 TRACE_EVENT0("browser", 148 TRACE_EVENT0("browser",
140 "TapSuppressionController::TapDownTimerExpired"); 149 "TapSuppressionController::TapDownTimerExpired");
141 client_->ForwardStashedTapDown(); 150 client_->ForwardStashedTapDown();
142 state_ = NOTHING; 151 state_ = NOTHING;
143 break; 152 break;
144 } 153 }
145 } 154 }
146 155
147 } // namespace content 156 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698