| 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/drag_window_resizer.h" | 5 #include "ash/wm/drag_window_resizer.h" |
| 6 | 6 |
| 7 #include "ash/display/mouse_cursor_event_filter.h" | 7 #include "ash/display/mouse_cursor_event_filter.h" |
| 8 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor()); | 607 EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor()); |
| 608 resizer->CompleteDrag(); | 608 resizer->CompleteDrag(); |
| 609 EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor()); | 609 EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor()); |
| 610 } | 610 } |
| 611 | 611 |
| 612 // Move window from the root window with 2.0 device scale factor to the root | 612 // Move window from the root window with 2.0 device scale factor to the root |
| 613 // window with 1.0 device scale factor. | 613 // window with 1.0 device scale factor. |
| 614 { | 614 { |
| 615 // Make sure the window is on the default container first. | 615 // Make sure the window is on the default container first. |
| 616 aura::Window* default_container = | 616 aura::Window* default_container = |
| 617 GetRootWindowController(root_windows[1]) | 617 RootWindowController::ForWindow(root_windows[1]) |
| 618 ->GetContainer(kShellWindowId_DefaultContainer); | 618 ->GetContainer(kShellWindowId_DefaultContainer); |
| 619 default_container->AddChild(window_.get()); | 619 default_container->AddChild(window_.get()); |
| 620 window_->SetBoundsInScreen( | 620 window_->SetBoundsInScreen( |
| 621 gfx::Rect(600, 0, 50, 60), | 621 gfx::Rect(600, 0, 50, 60), |
| 622 display::Screen::GetScreen()->GetDisplayNearestWindow(root_windows[1])); | 622 display::Screen::GetScreen()->GetDisplayNearestWindow(root_windows[1])); |
| 623 EXPECT_EQ(root_windows[1], window_->GetRootWindow()); | 623 EXPECT_EQ(root_windows[1], window_->GetRootWindow()); |
| 624 // Grab (0, 0) of the window. | 624 // Grab (0, 0) of the window. |
| 625 std::unique_ptr<WindowResizer> resizer( | 625 std::unique_ptr<WindowResizer> resizer( |
| 626 CreateDragWindowResizer(window_.get(), gfx::Point(), HTCAPTION)); | 626 CreateDragWindowResizer(window_.get(), gfx::Point(), HTCAPTION)); |
| 627 EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor()); | 627 EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor()); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 ASSERT_TRUE(resizer.get()); | 741 ASSERT_TRUE(resizer.get()); |
| 742 resizer->Drag(CalculateDragPoint(*resizer, 399, 200), 0); | 742 resizer->Drag(CalculateDragPoint(*resizer, 399, 200), 0); |
| 743 EXPECT_TRUE(TestIfMouseWarpsAt(gfx::Point(399, 200))); | 743 EXPECT_TRUE(TestIfMouseWarpsAt(gfx::Point(399, 200))); |
| 744 EXPECT_EQ("401,200", | 744 EXPECT_EQ("401,200", |
| 745 aura::Env::GetInstance()->last_mouse_location().ToString()); | 745 aura::Env::GetInstance()->last_mouse_location().ToString()); |
| 746 resizer->CompleteDrag(); | 746 resizer->CompleteDrag(); |
| 747 } | 747 } |
| 748 } | 748 } |
| 749 | 749 |
| 750 } // namespace ash | 750 } // namespace ash |
| OLD | NEW |