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" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 window->SetProperty(aura::client::kCanMaximizeKey, true); | 369 window->SetProperty(aura::client::kCanMaximizeKey, true); |
370 wd.set_window_component(HTCAPTION); | 370 wd.set_window_component(HTCAPTION); |
371 aura::Window* root = Shell::GetPrimaryRootWindow(); | 371 aura::Window* root = Shell::GetPrimaryRootWindow(); |
372 aura::test::EventGenerator generator(root, window.get()); | 372 aura::test::EventGenerator generator(root, window.get()); |
373 | 373 |
374 WindowPropertyObserver observer(window.get()); | 374 WindowPropertyObserver observer(window.get()); |
375 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, generator.current_location(), | 375 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, generator.current_location(), |
376 generator.current_location(), | 376 generator.current_location(), |
377 ui::EF_MIDDLE_MOUSE_BUTTON | ui::EF_IS_DOUBLE_CLICK, | 377 ui::EF_MIDDLE_MOUSE_BUTTON | ui::EF_IS_DOUBLE_CLICK, |
378 ui::EF_MIDDLE_MOUSE_BUTTON); | 378 ui::EF_MIDDLE_MOUSE_BUTTON); |
379 aura::WindowEventDispatcher* dispatcher = root->GetDispatcher(); | 379 aura::WindowEventDispatcher* dispatcher = root->GetHost()->dispatcher(); |
380 ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&press); | 380 ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&press); |
381 ASSERT_FALSE(details.dispatcher_destroyed); | 381 ASSERT_FALSE(details.dispatcher_destroyed); |
382 ui::MouseEvent release(ui::ET_MOUSE_RELEASED, generator.current_location(), | 382 ui::MouseEvent release(ui::ET_MOUSE_RELEASED, generator.current_location(), |
383 generator.current_location(), | 383 generator.current_location(), |
384 ui::EF_IS_DOUBLE_CLICK, | 384 ui::EF_IS_DOUBLE_CLICK, |
385 ui::EF_MIDDLE_MOUSE_BUTTON); | 385 ui::EF_MIDDLE_MOUSE_BUTTON); |
386 details = dispatcher->OnEventFromSource(&release); | 386 details = dispatcher->OnEventFromSource(&release); |
387 ASSERT_FALSE(details.dispatcher_destroyed); | 387 ASSERT_FALSE(details.dispatcher_destroyed); |
388 | 388 |
389 EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); | 389 EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 ASSERT_TRUE(aura::client::GetWindowMoveClient(window->GetRootWindow())); | 446 ASSERT_TRUE(aura::client::GetWindowMoveClient(window->GetRootWindow())); |
447 base::MessageLoop::current()->DeleteSoon(FROM_HERE, window.get()); | 447 base::MessageLoop::current()->DeleteSoon(FROM_HERE, window.get()); |
448 aura::client::GetWindowMoveClient(window->GetRootWindow()) | 448 aura::client::GetWindowMoveClient(window->GetRootWindow()) |
449 ->RunMoveLoop(window.release(), | 449 ->RunMoveLoop(window.release(), |
450 gfx::Vector2d(), | 450 gfx::Vector2d(), |
451 aura::client::WINDOW_MOVE_SOURCE_MOUSE); | 451 aura::client::WINDOW_MOVE_SOURCE_MOUSE); |
452 } | 452 } |
453 | 453 |
454 } // namespace internal | 454 } // namespace internal |
455 } // namespace ash | 455 } // namespace ash |
OLD | NEW |