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

Side by Side Diff: ash/display/unified_mouse_warp_controller_unittest.cc

Issue 2270553002: Move ash::DisplayInfo to ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/display/unified_mouse_warp_controller.h" 5 #include "ash/display/unified_mouse_warp_controller.h"
6 6
7 #include "ash/display/display_manager.h" 7 #include "ash/display/display_manager.h"
8 #include "ash/display/display_util.h" 8 #include "ash/display/display_util.h"
9 #include "ash/display/mirror_window_controller.h" 9 #include "ash/display/mirror_window_controller.h"
10 #include "ash/display/mouse_cursor_event_filter.h" 10 #include "ash/display/mouse_cursor_event_filter.h"
(...skipping 21 matching lines...) Expand all
32 } 32 }
33 33
34 protected: 34 protected:
35 bool FindMirrroingDisplayIdContainingNativePoint( 35 bool FindMirrroingDisplayIdContainingNativePoint(
36 const gfx::Point& point_in_native, 36 const gfx::Point& point_in_native,
37 int64_t* display_id, 37 int64_t* display_id,
38 gfx::Point* point_in_mirroring_host, 38 gfx::Point* point_in_mirroring_host,
39 gfx::Point* point_in_unified_host) { 39 gfx::Point* point_in_unified_host) {
40 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); 40 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
41 for (auto display : display_manager->software_mirroring_display_list()) { 41 for (auto display : display_manager->software_mirroring_display_list()) {
42 DisplayInfo info = display_manager->GetDisplayInfo(display.id()); 42 display::ManagedDisplayInfo info =
43 display_manager->GetDisplayInfo(display.id());
43 if (info.bounds_in_native().Contains(point_in_native)) { 44 if (info.bounds_in_native().Contains(point_in_native)) {
44 *display_id = info.id(); 45 *display_id = info.id();
45 *point_in_unified_host = point_in_native; 46 *point_in_unified_host = point_in_native;
46 const gfx::Point& origin = info.bounds_in_native().origin(); 47 const gfx::Point& origin = info.bounds_in_native().origin();
47 // Convert to mirroring host. 48 // Convert to mirroring host.
48 point_in_unified_host->Offset(-origin.x(), -origin.y()); 49 point_in_unified_host->Offset(-origin.x(), -origin.y());
49 *point_in_mirroring_host = *point_in_unified_host; 50 *point_in_mirroring_host = *point_in_unified_host;
50 // Convert from mirroring host to unified host. 51 // Convert from mirroring host to unified host.
51 AshWindowTreeHost* ash_host = 52 AshWindowTreeHost* ash_host =
52 Shell::GetInstance() 53 Shell::GetInstance()
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 EXPECT_TRUE(TestIfMouseWarpsAt(gfx::Point(600, 10))); 255 EXPECT_TRUE(TestIfMouseWarpsAt(gfx::Point(600, 10)));
255 EXPECT_EQ("249,5", // moved to 498 by 2px, divided by 2 (dsf). 256 EXPECT_EQ("249,5", // moved to 498 by 2px, divided by 2 (dsf).
256 aura::Env::GetInstance()->last_mouse_location().ToString()); 257 aura::Env::GetInstance()->last_mouse_location().ToString());
257 { 258 {
258 SCOPED_TRACE("1x2 NO WARP"); 259 SCOPED_TRACE("1x2 NO WARP");
259 NoWarpTestBody(); 260 NoWarpTestBody();
260 } 261 }
261 } 262 }
262 263
263 } // namespace aura 264 } // namespace aura
OLDNEW
« no previous file with comments | « ash/display/screen_orientation_controller_chromeos.cc ('k') | ash/display/window_tree_host_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698