OLD | NEW |
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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "content/browser/renderer_host/input/tap_suppression_controller.h" | 7 #include "content/browser/renderer_host/input/tap_suppression_controller.h" |
8 #include "content/browser/renderer_host/input/tap_suppression_controller_client.
h" | 8 #include "content/browser/renderer_host/input/tap_suppression_controller_client.
h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 timer_started_ = false; | 82 timer_started_ = false; |
83 TapDownTimerExpired(); | 83 TapDownTimerExpired(); |
84 } | 84 } |
85 } | 85 } |
86 | 86 |
87 State state() { return state_; } | 87 State state() { return state_; } |
88 | 88 |
89 int last_actions() { return last_actions_; } | 89 int last_actions() { return last_actions_; } |
90 | 90 |
91 protected: | 91 protected: |
92 virtual base::TimeTicks Now() OVERRIDE { | 92 virtual base::TimeTicks Now() override { |
93 return time_; | 93 return time_; |
94 } | 94 } |
95 | 95 |
96 virtual void StartTapDownTimer(const base::TimeDelta& delay) OVERRIDE { | 96 virtual void StartTapDownTimer(const base::TimeDelta& delay) override { |
97 timer_expiry_time_ = time_ + delay; | 97 timer_expiry_time_ = time_ + delay; |
98 timer_started_ = true; | 98 timer_started_ = true; |
99 } | 99 } |
100 | 100 |
101 virtual void StopTapDownTimer() OVERRIDE { | 101 virtual void StopTapDownTimer() override { |
102 timer_started_ = false; | 102 timer_started_ = false; |
103 } | 103 } |
104 | 104 |
105 private: | 105 private: |
106 // TapSuppressionControllerClient implementation | 106 // TapSuppressionControllerClient implementation |
107 virtual void DropStashedTapDown() OVERRIDE { | 107 virtual void DropStashedTapDown() override { |
108 last_actions_ |= TAP_DOWN_DROPPED; | 108 last_actions_ |= TAP_DOWN_DROPPED; |
109 } | 109 } |
110 | 110 |
111 virtual void ForwardStashedTapDown() OVERRIDE { | 111 virtual void ForwardStashedTapDown() override { |
112 last_actions_ |= STASHED_TAP_DOWN_FORWARDED; | 112 last_actions_ |= STASHED_TAP_DOWN_FORWARDED; |
113 } | 113 } |
114 | 114 |
115 // Hiding some derived public methods | 115 // Hiding some derived public methods |
116 using TapSuppressionController::GestureFlingCancel; | 116 using TapSuppressionController::GestureFlingCancel; |
117 using TapSuppressionController::GestureFlingCancelAck; | 117 using TapSuppressionController::GestureFlingCancelAck; |
118 using TapSuppressionController::ShouldDeferTapDown; | 118 using TapSuppressionController::ShouldDeferTapDown; |
119 using TapSuppressionController::ShouldSuppressTapEnd; | 119 using TapSuppressionController::ShouldSuppressTapEnd; |
120 | 120 |
121 int last_actions_; | 121 int last_actions_; |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 | 528 |
529 // Send TapUp. This TapUp should not be suppressed. | 529 // Send TapUp. This TapUp should not be suppressed. |
530 tap_suppression_controller_->SendTapUp(); | 530 tap_suppression_controller_->SendTapUp(); |
531 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED, | 531 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED, |
532 tap_suppression_controller_->last_actions()); | 532 tap_suppression_controller_->last_actions()); |
533 EXPECT_EQ(MockTapSuppressionController::DISABLED, | 533 EXPECT_EQ(MockTapSuppressionController::DISABLED, |
534 tap_suppression_controller_->state()); | 534 tap_suppression_controller_->state()); |
535 } | 535 } |
536 | 536 |
537 } // namespace content | 537 } // namespace content |
OLD | NEW |