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/aura/wm_lookup_aura.h" | 5 #include "ash/aura/wm_lookup_aura.h" |
6 | 6 |
7 #include "ash/aura/wm_root_window_controller_aura.h" | |
8 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
9 #include "ash/common/wm_layout_manager.h" | 8 #include "ash/common/wm_layout_manager.h" |
10 #include "ash/display/window_tree_host_manager.h" | 9 #include "ash/display/window_tree_host_manager.h" |
| 10 #include "ash/root_window_controller.h" |
11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ui/views/widget/widget.h" |
12 | 13 |
13 namespace ash { | 14 namespace ash { |
14 | 15 |
15 WmLookupAura::WmLookupAura() { | 16 WmLookupAura::WmLookupAura() { |
16 WmLookup::Set(this); | 17 WmLookup::Set(this); |
17 } | 18 } |
18 | 19 |
19 WmLookupAura::~WmLookupAura() { | 20 WmLookupAura::~WmLookupAura() { |
20 WmLookup::Set(nullptr); | 21 WmLookup::Set(nullptr); |
21 } | 22 } |
22 | 23 |
23 WmRootWindowController* WmLookupAura::GetRootWindowControllerWithDisplayId( | 24 WmRootWindowController* WmLookupAura::GetRootWindowControllerWithDisplayId( |
24 int64_t id) { | 25 int64_t id) { |
25 return WmRootWindowControllerAura::Get(Shell::GetInstance() | 26 aura::Window* root_window = Shell::GetInstance() |
26 ->window_tree_host_manager() | 27 ->window_tree_host_manager() |
27 ->GetRootWindowForDisplayId(id)); | 28 ->GetRootWindowForDisplayId(id); |
| 29 return root_window |
| 30 ? RootWindowController::ForWindow(root_window) |
| 31 ->wm_root_window_controller() |
| 32 : nullptr; |
28 } | 33 } |
29 | 34 |
30 WmWindow* WmLookupAura::GetWindowForWidget(views::Widget* widget) { | 35 WmWindow* WmLookupAura::GetWindowForWidget(views::Widget* widget) { |
31 return WmWindowAura::Get(widget->GetNativeWindow()); | 36 return WmWindowAura::Get(widget->GetNativeWindow()); |
32 } | 37 } |
33 | 38 |
34 } // namespace ash | 39 } // namespace ash |
OLD | NEW |