| OLD | NEW |
| 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 Loading... |
| 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 ui::DisplayInfo info = display_manager->GetDisplayInfo(display.id()); |
| 43 if (info.bounds_in_native().Contains(point_in_native)) { | 43 if (info.bounds_in_native().Contains(point_in_native)) { |
| 44 *display_id = info.id(); | 44 *display_id = info.id(); |
| 45 *point_in_unified_host = point_in_native; | 45 *point_in_unified_host = point_in_native; |
| 46 const gfx::Point& origin = info.bounds_in_native().origin(); | 46 const gfx::Point& origin = info.bounds_in_native().origin(); |
| 47 // Convert to mirroring host. | 47 // Convert to mirroring host. |
| 48 point_in_unified_host->Offset(-origin.x(), -origin.y()); | 48 point_in_unified_host->Offset(-origin.x(), -origin.y()); |
| 49 *point_in_mirroring_host = *point_in_unified_host; | 49 *point_in_mirroring_host = *point_in_unified_host; |
| 50 // Convert from mirroring host to unified host. | 50 // Convert from mirroring host to unified host. |
| 51 AshWindowTreeHost* ash_host = | 51 AshWindowTreeHost* ash_host = |
| 52 Shell::GetInstance() | 52 Shell::GetInstance() |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 EXPECT_TRUE(TestIfMouseWarpsAt(gfx::Point(600, 10))); | 254 EXPECT_TRUE(TestIfMouseWarpsAt(gfx::Point(600, 10))); |
| 255 EXPECT_EQ("249,5", // moved to 498 by 2px, divided by 2 (dsf). | 255 EXPECT_EQ("249,5", // moved to 498 by 2px, divided by 2 (dsf). |
| 256 aura::Env::GetInstance()->last_mouse_location().ToString()); | 256 aura::Env::GetInstance()->last_mouse_location().ToString()); |
| 257 { | 257 { |
| 258 SCOPED_TRACE("1x2 NO WARP"); | 258 SCOPED_TRACE("1x2 NO WARP"); |
| 259 NoWarpTestBody(); | 259 NoWarpTestBody(); |
| 260 } | 260 } |
| 261 } | 261 } |
| 262 | 262 |
| 263 } // namespace aura | 263 } // namespace aura |
| OLD | NEW |