OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ash/mus/screen_mus.h" |
| 6 |
| 7 #include "ui/aura/mus/window_tree_host_mus.h" |
| 8 #include "ui/aura/window.h" |
| 9 |
| 10 namespace ash { |
| 11 |
| 12 ScreenMus::ScreenMus() = default; |
| 13 |
| 14 ScreenMus::~ScreenMus() = default; |
| 15 |
| 16 display::Display ScreenMus::GetDisplayNearestWindow( |
| 17 aura::Window* window) const { |
| 18 const aura::WindowTreeHost* host = window->GetHost(); |
| 19 if (!host) |
| 20 return GetPrimaryDisplay(); |
| 21 auto iter = display_list().FindDisplayById( |
| 22 static_cast<const aura::WindowTreeHostMus*>(host)->display_id()); |
| 23 return iter == display_list().displays().end() ? GetPrimaryDisplay() : *iter; |
| 24 } |
| 25 |
| 26 } // namespace ash |
OLD | NEW |