OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/magnifier/magnification_controller.h" | 5 #include "ash/magnifier/magnification_controller.h" |
6 #include "ash/magnifier/magnifier_constants.h" | 6 #include "ash/magnifier/magnifier_constants.h" |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 AshTestBase::TearDown(); | 47 AshTestBase::TearDown(); |
48 } | 48 } |
49 | 49 |
50 protected: | 50 protected: |
51 aura::Window* GetRootWindow() const { | 51 aura::Window* GetRootWindow() const { |
52 return Shell::GetPrimaryRootWindow(); | 52 return Shell::GetPrimaryRootWindow(); |
53 } | 53 } |
54 | 54 |
55 std::string GetHostMouseLocation() { | 55 std::string GetHostMouseLocation() { |
56 gfx::Point point; | 56 gfx::Point point; |
57 GetRootWindow()->GetDispatcher()->QueryMouseLocationForTest(&point); | 57 GetRootWindow()->GetDispatcher()->host()->QueryMouseLocation(&point); |
58 return point.ToString(); | 58 return point.ToString(); |
59 } | 59 } |
60 | 60 |
61 ash::MagnificationController* GetMagnificationController() const { | 61 ash::MagnificationController* GetMagnificationController() const { |
62 return ash::Shell::GetInstance()->magnification_controller(); | 62 return ash::Shell::GetInstance()->magnification_controller(); |
63 } | 63 } |
64 | 64 |
65 gfx::Rect GetViewport() const { | 65 gfx::Rect GetViewport() const { |
66 gfx::RectF bounds(0, 0, kRootWidth, kRootHeight); | 66 gfx::RectF bounds(0, 0, kRootWidth, kRootHeight); |
67 GetRootWindow()->layer()->transform().TransformRectReverse(&bounds); | 67 GetRootWindow()->layer()->transform().TransformRectReverse(&bounds); |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 scale *= kMagnificationScaleFactor; | 433 scale *= kMagnificationScaleFactor; |
434 GetMagnificationController()->SetScale(scale, false); | 434 GetMagnificationController()->SetScale(scale, false); |
435 EXPECT_FLOAT_EQ(4.f, GetMagnificationController()->GetScale()); | 435 EXPECT_FLOAT_EQ(4.f, GetMagnificationController()->GetScale()); |
436 generator.MoveMouseToInHost(gfx::Point(0, 300)); | 436 generator.MoveMouseToInHost(gfx::Point(0, 300)); |
437 EXPECT_EQ("139,298", env->last_mouse_location().ToString()); | 437 EXPECT_EQ("139,298", env->last_mouse_location().ToString()); |
438 EXPECT_EQ("100,300", GetHostMouseLocation()); | 438 EXPECT_EQ("100,300", GetHostMouseLocation()); |
439 } | 439 } |
440 | 440 |
441 } // namespace internal | 441 } // namespace internal |
442 } // namespace ash | 442 } // namespace ash |
OLD | NEW |