| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/mus/screen_mus.h" | 5 #include "ash/mus/screen_mus.h" |
| 6 | 6 |
| 7 #include "ash/common/wm/root_window_finder.h" | 7 #include "ash/common/wm/root_window_finder.h" |
| 8 #include "ash/common/wm_window.h" | 8 #include "ash/common/wm_window.h" |
| 9 #include "services/ui/public/interfaces/display/display_controller.mojom.h" | 9 #include "services/ui/public/interfaces/display/display_controller.mojom.h" |
| 10 #include "ui/aura/client/screen_position_client.h" | 10 #include "ui/aura/client/screen_position_client.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 return; | 32 return; |
| 33 | 33 |
| 34 display_list().UpdateDisplay(new_display); | 34 display_list().UpdateDisplay(new_display); |
| 35 if (display_controller_) { | 35 if (display_controller_) { |
| 36 display_controller_->SetDisplayWorkArea( | 36 display_controller_->SetDisplayWorkArea( |
| 37 new_display.id(), new_display.bounds().size(), insets); | 37 new_display.id(), new_display.bounds().size(), insets); |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 display::Display ScreenMus::GetDisplayNearestWindow( | 41 display::Display ScreenMus::GetDisplayNearestWindow( |
| 42 aura::Window* window) const { | 42 gfx::NativeWindow window) const { |
| 43 const aura::WindowTreeHost* host = window->GetHost(); | 43 const aura::WindowTreeHost* host = window->GetHost(); |
| 44 if (!host) | 44 if (!host) |
| 45 return GetPrimaryDisplay(); | 45 return GetPrimaryDisplay(); |
| 46 auto iter = display_list().FindDisplayById( | 46 auto iter = display_list().FindDisplayById( |
| 47 static_cast<const aura::WindowTreeHostMus*>(host)->display_id()); | 47 static_cast<const aura::WindowTreeHostMus*>(host)->display_id()); |
| 48 return iter == display_list().displays().end() ? GetPrimaryDisplay() : *iter; | 48 return iter == display_list().displays().end() ? GetPrimaryDisplay() : *iter; |
| 49 } | 49 } |
| 50 | 50 |
| 51 gfx::Point ScreenMus::GetCursorScreenPoint() { | 51 gfx::Point ScreenMus::GetCursorScreenPoint() { |
| 52 return aura::Env::GetInstance()->last_mouse_location(); | 52 return aura::Env::GetInstance()->last_mouse_location(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 63 aura::client::GetScreenPositionClient(root_window); | 63 aura::client::GetScreenPositionClient(root_window); |
| 64 | 64 |
| 65 gfx::Point local_point = point; | 65 gfx::Point local_point = point; |
| 66 if (position_client) | 66 if (position_client) |
| 67 position_client->ConvertPointFromScreen(root_window, &local_point); | 67 position_client->ConvertPointFromScreen(root_window, &local_point); |
| 68 | 68 |
| 69 return root_window->GetEventHandlerForPoint(local_point); | 69 return root_window->GetEventHandlerForPoint(local_point); |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace ash | 72 } // namespace ash |
| OLD | NEW |