| 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 "ui/aura/root_window.h" | 5 #include "ui/aura/root_window.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "ui/aura/client/event_client.h" | 10 #include "ui/aura/client/event_client.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 virtual bool PreHandleMouseEvent(Window* target, | 88 virtual bool PreHandleMouseEvent(Window* target, |
| 89 ui::MouseEvent* event) OVERRIDE { | 89 ui::MouseEvent* event) OVERRIDE { |
| 90 num_mouse_events_++; | 90 num_mouse_events_++; |
| 91 return true; | 91 return true; |
| 92 } | 92 } |
| 93 virtual ui::TouchStatus PreHandleTouchEvent( | 93 virtual ui::TouchStatus PreHandleTouchEvent( |
| 94 Window* target, ui::TouchEvent* event) OVERRIDE { | 94 Window* target, ui::TouchEvent* event) OVERRIDE { |
| 95 return ui::TOUCH_STATUS_UNKNOWN; | 95 return ui::TOUCH_STATUS_UNKNOWN; |
| 96 } | 96 } |
| 97 virtual ui::GestureStatus PreHandleGestureEvent( | 97 virtual ui::GestureStatus PreHandleGestureEvent( |
| 98 Window* target, ui::GestureEventImpl* event) OVERRIDE { | 98 Window* target, ui::GestureEvent* event) OVERRIDE { |
| 99 return ui::GESTURE_STATUS_UNKNOWN; | 99 return ui::GESTURE_STATUS_UNKNOWN; |
| 100 } | 100 } |
| 101 | 101 |
| 102 private: | 102 private: |
| 103 // How many key events have been received? | 103 // How many key events have been received? |
| 104 int num_key_events_; | 104 int num_key_events_; |
| 105 | 105 |
| 106 // How many mouse events have been received? | 106 // How many mouse events have been received? |
| 107 int num_mouse_events_; | 107 int num_mouse_events_; |
| 108 | 108 |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 return true; | 367 return true; |
| 368 } | 368 } |
| 369 virtual ui::TouchStatus PreHandleTouchEvent( | 369 virtual ui::TouchStatus PreHandleTouchEvent( |
| 370 Window* target, | 370 Window* target, |
| 371 ui::TouchEvent* event) OVERRIDE { | 371 ui::TouchEvent* event) OVERRIDE { |
| 372 events_.push_back(event->type()); | 372 events_.push_back(event->type()); |
| 373 return ui::TOUCH_STATUS_UNKNOWN; | 373 return ui::TOUCH_STATUS_UNKNOWN; |
| 374 } | 374 } |
| 375 virtual ui::GestureStatus PreHandleGestureEvent( | 375 virtual ui::GestureStatus PreHandleGestureEvent( |
| 376 Window* target, | 376 Window* target, |
| 377 ui::GestureEventImpl* event) OVERRIDE { | 377 ui::GestureEvent* event) OVERRIDE { |
| 378 events_.push_back(event->type()); | 378 events_.push_back(event->type()); |
| 379 return ui::GESTURE_STATUS_UNKNOWN; | 379 return ui::GESTURE_STATUS_UNKNOWN; |
| 380 } | 380 } |
| 381 | 381 |
| 382 private: | 382 private: |
| 383 Events events_; | 383 Events events_; |
| 384 | 384 |
| 385 DISALLOW_COPY_AND_ASSIGN(EventFilterRecorder); | 385 DISALLOW_COPY_AND_ASSIGN(EventFilterRecorder); |
| 386 }; | 386 }; |
| 387 | 387 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 root_window()->ReleaseMouseMoves(); | 538 root_window()->ReleaseMouseMoves(); |
| 539 root_window()->AsRootWindowHostDelegate()->OnHostMouseEvent( | 539 root_window()->AsRootWindowHostDelegate()->OnHostMouseEvent( |
| 540 &mouse_dragged_event2); | 540 &mouse_dragged_event2); |
| 541 EXPECT_EQ("MOUSE_DRAGGED", EventTypesToString(filter->events())); | 541 EXPECT_EQ("MOUSE_DRAGGED", EventTypesToString(filter->events())); |
| 542 filter->events().clear(); | 542 filter->events().clear(); |
| 543 RunAllPendingInMessageLoop(); | 543 RunAllPendingInMessageLoop(); |
| 544 EXPECT_TRUE(filter->events().empty()); | 544 EXPECT_TRUE(filter->events().empty()); |
| 545 } | 545 } |
| 546 | 546 |
| 547 } // namespace aura | 547 } // namespace aura |
| OLD | NEW |