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

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

Issue 72503002: Remove some pass-thrus on RootWindow API in favor of exposing the RootWindowHost again. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month 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
« no previous file with comments | « ash/display/virtual_keyboard_window_controller.cc ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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
OLDNEW
« no previous file with comments | « ash/display/virtual_keyboard_window_controller.cc ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698