Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Side by Side Diff: ash/magnifier/magnification_controller_unittest.cc

Issue 184903003: Window ownership -> WindowTreeHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/magnifier/magnification_controller.cc ('k') | ash/magnifier/partial_magnification_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698