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 "ash/wm/workspace/workspace_event_handler.h" | 5 #include "ash/wm/workspace/workspace_event_handler.h" |
6 | 6 |
7 #include "ash/screen_util.h" | 7 #include "ash/screen_util.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
10 #include "ash/wm/window_state.h" | 10 #include "ash/wm/window_state.h" |
11 #include "ash/wm/window_util.h" | 11 #include "ash/wm/window_util.h" |
12 #include "ash/wm/wm_event.h" | 12 #include "ash/wm/wm_event.h" |
13 #include "ash/wm/workspace_controller.h" | 13 #include "ash/wm/workspace_controller.h" |
14 #include "ash/wm/workspace_controller_test_helper.h" | 14 #include "ash/wm/workspace_controller_test_helper.h" |
15 #include "ui/aura/client/aura_constants.h" | 15 #include "ui/aura/client/aura_constants.h" |
16 #include "ui/aura/client/window_move_client.h" | 16 #include "ui/aura/client/window_move_client.h" |
17 #include "ui/aura/test/event_generator.h" | 17 #include "ui/aura/test/event_generator.h" |
18 #include "ui/aura/test/test_window_delegate.h" | 18 #include "ui/aura/test/test_window_delegate.h" |
19 #include "ui/aura/window.h" | 19 #include "ui/aura/window.h" |
20 #include "ui/aura/window_event_dispatcher.h" | 20 #include "ui/aura/window_tree_host.h" |
21 #include "ui/base/hit_test.h" | 21 #include "ui/base/hit_test.h" |
| 22 #include "ui/events/event_processor.h" |
22 #include "ui/gfx/screen.h" | 23 #include "ui/gfx/screen.h" |
23 #include "ui/views/corewm/window_util.h" | 24 #include "ui/views/corewm/window_util.h" |
24 | 25 |
25 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
26 #include "base/win/windows_version.h" | 27 #include "base/win/windows_version.h" |
27 #endif | 28 #endif |
28 | 29 |
29 namespace ash { | 30 namespace ash { |
30 namespace internal { | 31 namespace internal { |
31 | 32 |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 window->SetProperty(aura::client::kCanMaximizeKey, true); | 373 window->SetProperty(aura::client::kCanMaximizeKey, true); |
373 wd.set_window_component(HTCAPTION); | 374 wd.set_window_component(HTCAPTION); |
374 aura::Window* root = Shell::GetPrimaryRootWindow(); | 375 aura::Window* root = Shell::GetPrimaryRootWindow(); |
375 aura::test::EventGenerator generator(root, window.get()); | 376 aura::test::EventGenerator generator(root, window.get()); |
376 | 377 |
377 WindowPropertyObserver observer(window.get()); | 378 WindowPropertyObserver observer(window.get()); |
378 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, generator.current_location(), | 379 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, generator.current_location(), |
379 generator.current_location(), | 380 generator.current_location(), |
380 ui::EF_MIDDLE_MOUSE_BUTTON | ui::EF_IS_DOUBLE_CLICK, | 381 ui::EF_MIDDLE_MOUSE_BUTTON | ui::EF_IS_DOUBLE_CLICK, |
381 ui::EF_MIDDLE_MOUSE_BUTTON); | 382 ui::EF_MIDDLE_MOUSE_BUTTON); |
382 aura::WindowEventDispatcher* dispatcher = root->GetHost()->dispatcher(); | 383 ui::EventProcessor* dispatcher = root->GetHost()->event_processor(); |
383 ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&press); | 384 ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&press); |
384 ASSERT_FALSE(details.dispatcher_destroyed); | 385 ASSERT_FALSE(details.dispatcher_destroyed); |
385 ui::MouseEvent release(ui::ET_MOUSE_RELEASED, generator.current_location(), | 386 ui::MouseEvent release(ui::ET_MOUSE_RELEASED, generator.current_location(), |
386 generator.current_location(), | 387 generator.current_location(), |
387 ui::EF_IS_DOUBLE_CLICK, | 388 ui::EF_IS_DOUBLE_CLICK, |
388 ui::EF_MIDDLE_MOUSE_BUTTON); | 389 ui::EF_MIDDLE_MOUSE_BUTTON); |
389 details = dispatcher->OnEventFromSource(&release); | 390 details = dispatcher->OnEventFromSource(&release); |
390 ASSERT_FALSE(details.dispatcher_destroyed); | 391 ASSERT_FALSE(details.dispatcher_destroyed); |
391 | 392 |
392 EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); | 393 EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 ASSERT_TRUE(aura::client::GetWindowMoveClient(window->GetRootWindow())); | 450 ASSERT_TRUE(aura::client::GetWindowMoveClient(window->GetRootWindow())); |
450 base::MessageLoop::current()->DeleteSoon(FROM_HERE, window.get()); | 451 base::MessageLoop::current()->DeleteSoon(FROM_HERE, window.get()); |
451 aura::client::GetWindowMoveClient(window->GetRootWindow()) | 452 aura::client::GetWindowMoveClient(window->GetRootWindow()) |
452 ->RunMoveLoop(window.release(), | 453 ->RunMoveLoop(window.release(), |
453 gfx::Vector2d(), | 454 gfx::Vector2d(), |
454 aura::client::WINDOW_MOVE_SOURCE_MOUSE); | 455 aura::client::WINDOW_MOVE_SOURCE_MOUSE); |
455 } | 456 } |
456 | 457 |
457 } // namespace internal | 458 } // namespace internal |
458 } // namespace ash | 459 } // namespace ash |
OLD | NEW |