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