| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/memory/scoped_vector.h" | 5 #include "base/memory/scoped_vector.h" |
| 6 #include "base/string_number_conversions.h" | 6 #include "base/string_number_conversions.h" |
| 7 #include "base/timer.h" | 7 #include "base/timer.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "ui/aura/root_window.h" | 9 #include "ui/aura/root_window.h" |
| 10 #include "ui/aura/test/aura_test_base.h" | 10 #include "ui/aura/test/aura_test_base.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 float scroll_x() const { return scroll_x_; } | 125 float scroll_x() const { return scroll_x_; } |
| 126 float scroll_y() const { return scroll_y_; } | 126 float scroll_y() const { return scroll_y_; } |
| 127 float scroll_velocity_x() const { return scroll_velocity_x_; } | 127 float scroll_velocity_x() const { return scroll_velocity_x_; } |
| 128 float scroll_velocity_y() const { return scroll_velocity_y_; } | 128 float scroll_velocity_y() const { return scroll_velocity_y_; } |
| 129 int touch_id() const { return touch_id_; } | 129 int touch_id() const { return touch_id_; } |
| 130 float velocity_x() const { return velocity_x_; } | 130 float velocity_x() const { return velocity_x_; } |
| 131 float velocity_y() const { return velocity_y_; } | 131 float velocity_y() const { return velocity_y_; } |
| 132 const gfx::Rect& bounding_box() const { return bounding_box_; } | 132 const gfx::Rect& bounding_box() const { return bounding_box_; } |
| 133 int tap_count() const { return tap_count_; } | 133 int tap_count() const { return tap_count_; } |
| 134 | 134 |
| 135 virtual ui::GestureStatus OnGestureEvent( | 135 virtual ui::EventResult OnGestureEvent( |
| 136 ui::GestureEvent* gesture) OVERRIDE { | 136 ui::GestureEvent* gesture) OVERRIDE { |
| 137 bounding_box_ = gesture->details().bounding_box(); | 137 bounding_box_ = gesture->details().bounding_box(); |
| 138 switch (gesture->type()) { | 138 switch (gesture->type()) { |
| 139 case ui::ET_GESTURE_TAP: | 139 case ui::ET_GESTURE_TAP: |
| 140 tap_location_ = gesture->location(); | 140 tap_location_ = gesture->location(); |
| 141 tap_count_ = gesture->details().tap_count(); | 141 tap_count_ = gesture->details().tap_count(); |
| 142 tap_ = true; | 142 tap_ = true; |
| 143 break; | 143 break; |
| 144 case ui::ET_GESTURE_TAP_DOWN: | 144 case ui::ET_GESTURE_TAP_DOWN: |
| 145 tap_down_ = true; | 145 tap_down_ = true; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 break; | 194 break; |
| 195 case ui::ET_GESTURE_MULTIFINGER_SWIPE: | 195 case ui::ET_GESTURE_MULTIFINGER_SWIPE: |
| 196 swipe_left_ = gesture->details().swipe_left(); | 196 swipe_left_ = gesture->details().swipe_left(); |
| 197 swipe_right_ = gesture->details().swipe_right(); | 197 swipe_right_ = gesture->details().swipe_right(); |
| 198 swipe_up_ = gesture->details().swipe_up(); | 198 swipe_up_ = gesture->details().swipe_up(); |
| 199 swipe_down_ = gesture->details().swipe_down(); | 199 swipe_down_ = gesture->details().swipe_down(); |
| 200 break; | 200 break; |
| 201 default: | 201 default: |
| 202 NOTREACHED(); | 202 NOTREACHED(); |
| 203 } | 203 } |
| 204 return ui::GESTURE_STATUS_CONSUMED; | 204 return ui::ER_CONSUMED; |
| 205 } | 205 } |
| 206 | 206 |
| 207 private: | 207 private: |
| 208 bool tap_; | 208 bool tap_; |
| 209 bool tap_down_; | 209 bool tap_down_; |
| 210 bool begin_; | 210 bool begin_; |
| 211 bool end_; | 211 bool end_; |
| 212 bool double_tap_; | 212 bool double_tap_; |
| 213 bool scroll_begin_; | 213 bool scroll_begin_; |
| 214 bool scroll_update_; | 214 bool scroll_update_; |
| (...skipping 2610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2825 root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); | 2825 root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); |
| 2826 EXPECT_FALSE(delegate->tap()); | 2826 EXPECT_FALSE(delegate->tap()); |
| 2827 EXPECT_FALSE(delegate->scroll_update()); | 2827 EXPECT_FALSE(delegate->scroll_update()); |
| 2828 EXPECT_FALSE(delegate->pinch_update()); | 2828 EXPECT_FALSE(delegate->pinch_update()); |
| 2829 | 2829 |
| 2830 delegate->Reset(); | 2830 delegate->Reset(); |
| 2831 } | 2831 } |
| 2832 | 2832 |
| 2833 } // namespace test | 2833 } // namespace test |
| 2834 } // namespace aura | 2834 } // namespace aura |
| OLD | NEW |