| 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 "ui/aura/env.h" |
| 7 #include "ui/aura/mus/window_tree_host_mus.h" | 8 #include "ui/aura/mus/window_tree_host_mus.h" |
| 8 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 9 | 10 |
| 10 namespace ash { | 11 namespace ash { |
| 11 | 12 |
| 12 ScreenMus::ScreenMus() = default; | 13 ScreenMus::ScreenMus() = default; |
| 13 | 14 |
| 14 ScreenMus::~ScreenMus() = default; | 15 ScreenMus::~ScreenMus() = default; |
| 15 | 16 |
| 16 display::Display ScreenMus::GetDisplayNearestWindow( | 17 display::Display ScreenMus::GetDisplayNearestWindow( |
| 17 aura::Window* window) const { | 18 aura::Window* window) const { |
| 18 const aura::WindowTreeHost* host = window->GetHost(); | 19 const aura::WindowTreeHost* host = window->GetHost(); |
| 19 if (!host) | 20 if (!host) |
| 20 return GetPrimaryDisplay(); | 21 return GetPrimaryDisplay(); |
| 21 auto iter = display_list().FindDisplayById( | 22 auto iter = display_list().FindDisplayById( |
| 22 static_cast<const aura::WindowTreeHostMus*>(host)->display_id()); | 23 static_cast<const aura::WindowTreeHostMus*>(host)->display_id()); |
| 23 return iter == display_list().displays().end() ? GetPrimaryDisplay() : *iter; | 24 return iter == display_list().displays().end() ? GetPrimaryDisplay() : *iter; |
| 24 } | 25 } |
| 25 | 26 |
| 27 gfx::Point ScreenMus::GetCursorScreenPoint() { |
| 28 return aura::Env::GetInstance()->last_mouse_location(); |
| 29 } |
| 30 |
| 26 } // namespace ash | 31 } // namespace ash |
| OLD | NEW |