| 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 double_click_ = false; | 297 double_click_ = false; |
| 298 } | 298 } |
| 299 | 299 |
| 300 bool mouse_enter() const { return mouse_enter_; } | 300 bool mouse_enter() const { return mouse_enter_; } |
| 301 bool mouse_exit() const { return mouse_exit_; } | 301 bool mouse_exit() const { return mouse_exit_; } |
| 302 bool mouse_press() const { return mouse_press_; } | 302 bool mouse_press() const { return mouse_press_; } |
| 303 bool mouse_move() const { return mouse_move_; } | 303 bool mouse_move() const { return mouse_move_; } |
| 304 bool mouse_release() const { return mouse_release_; } | 304 bool mouse_release() const { return mouse_release_; } |
| 305 bool double_click() const { return double_click_; } | 305 bool double_click() const { return double_click_; } |
| 306 | 306 |
| 307 virtual bool OnMouseEvent(ui::MouseEvent* event) OVERRIDE { | 307 virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE { |
| 308 switch (event->type()) { | 308 switch (event->type()) { |
| 309 case ui::ET_MOUSE_PRESSED: | 309 case ui::ET_MOUSE_PRESSED: |
| 310 double_click_ = event->flags() & ui::EF_IS_DOUBLE_CLICK; | 310 double_click_ = event->flags() & ui::EF_IS_DOUBLE_CLICK; |
| 311 mouse_press_ = true; | 311 mouse_press_ = true; |
| 312 break; | 312 break; |
| 313 case ui::ET_MOUSE_RELEASED: | 313 case ui::ET_MOUSE_RELEASED: |
| 314 mouse_release_ = true; | 314 mouse_release_ = true; |
| 315 break; | 315 break; |
| 316 case ui::ET_MOUSE_MOVED: | 316 case ui::ET_MOUSE_MOVED: |
| 317 mouse_move_ = true; | 317 mouse_move_ = true; |
| 318 break; | 318 break; |
| 319 case ui::ET_MOUSE_ENTERED: | 319 case ui::ET_MOUSE_ENTERED: |
| 320 mouse_enter_ = true; | 320 mouse_enter_ = true; |
| 321 break; | 321 break; |
| 322 case ui::ET_MOUSE_EXITED: | 322 case ui::ET_MOUSE_EXITED: |
| 323 mouse_exit_ = true; | 323 mouse_exit_ = true; |
| 324 break; | 324 break; |
| 325 default: | 325 default: |
| 326 NOTREACHED(); | 326 NOTREACHED(); |
| 327 } | 327 } |
| 328 return true; | 328 return ui::ER_HANDLED; |
| 329 } | 329 } |
| 330 | 330 |
| 331 private: | 331 private: |
| 332 bool mouse_enter_; | 332 bool mouse_enter_; |
| 333 bool mouse_exit_; | 333 bool mouse_exit_; |
| 334 bool mouse_press_; | 334 bool mouse_press_; |
| 335 bool mouse_release_; | 335 bool mouse_release_; |
| 336 bool mouse_move_; | 336 bool mouse_move_; |
| 337 bool double_click_; | 337 bool double_click_; |
| 338 | 338 |
| (...skipping 2492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2831 root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); | 2831 root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2); |
| 2832 EXPECT_FALSE(delegate->tap()); | 2832 EXPECT_FALSE(delegate->tap()); |
| 2833 EXPECT_FALSE(delegate->scroll_update()); | 2833 EXPECT_FALSE(delegate->scroll_update()); |
| 2834 EXPECT_FALSE(delegate->pinch_update()); | 2834 EXPECT_FALSE(delegate->pinch_update()); |
| 2835 | 2835 |
| 2836 delegate->Reset(); | 2836 delegate->Reset(); |
| 2837 } | 2837 } |
| 2838 | 2838 |
| 2839 } // namespace test | 2839 } // namespace test |
| 2840 } // namespace aura | 2840 } // namespace aura |
| OLD | NEW |