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/bridge/wm_root_window_controller_mus.h" | 5 #include "ash/mus/bridge/wm_root_window_controller_mus.h" |
6 | 6 |
7 #include "ash/mus/bridge/wm_shelf_mus.h" | 7 #include "ash/mus/bridge/wm_shelf_mus.h" |
8 #include "ash/mus/bridge/wm_shell_mus.h" | 8 #include "ash/mus/bridge/wm_shell_mus.h" |
9 #include "ash/mus/bridge/wm_window_mus.h" | 9 #include "ash/mus/bridge/wm_window_mus.h" |
10 #include "ash/mus/container_ids.h" | 10 #include "ash/mus/container_ids.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 const gfx::Point& point) const { | 68 const gfx::Point& point) const { |
69 gfx::Point result = point; | 69 gfx::Point result = point; |
70 result -= GetDisplay().bounds().OffsetFromOrigin(); | 70 result -= GetDisplay().bounds().OffsetFromOrigin(); |
71 return target->GetRootWindow()->ConvertPointToTarget(target, result); | 71 return target->GetRootWindow()->ConvertPointToTarget(target, result); |
72 } | 72 } |
73 | 73 |
74 const display::Display& WmRootWindowControllerMus::GetDisplay() const { | 74 const display::Display& WmRootWindowControllerMus::GetDisplay() const { |
75 return root_window_controller_->display(); | 75 return root_window_controller_->display(); |
76 } | 76 } |
77 | 77 |
| 78 void WmRootWindowControllerMus::MoveWindowsTo(WmWindow* dest) { |
| 79 WmRootWindowController::MoveWindowsTo(dest); |
| 80 } |
| 81 |
78 bool WmRootWindowControllerMus::HasShelf() { | 82 bool WmRootWindowControllerMus::HasShelf() { |
79 return GetShelf() != nullptr; | 83 return GetShelf() != nullptr; |
80 } | 84 } |
81 | 85 |
82 WmShell* WmRootWindowControllerMus::GetShell() { | 86 WmShell* WmRootWindowControllerMus::GetShell() { |
83 return shell_; | 87 return shell_; |
84 } | 88 } |
85 | 89 |
86 AlwaysOnTopController* WmRootWindowControllerMus::GetAlwaysOnTopController() { | |
87 return root_window_controller_->always_on_top_controller(); | |
88 } | |
89 | |
90 WmShelf* WmRootWindowControllerMus::GetShelf() { | 90 WmShelf* WmRootWindowControllerMus::GetShelf() { |
91 return root_window_controller_->wm_shelf(); | 91 return root_window_controller_->wm_shelf(); |
92 } | 92 } |
93 | 93 |
94 WmWindow* WmRootWindowControllerMus::GetWindow() { | 94 WmWindow* WmRootWindowControllerMus::GetWindow() { |
95 return WmWindowMus::Get(root_window_controller_->root()); | 95 return WmWindowMus::Get(root_window_controller_->root()); |
96 } | 96 } |
97 | 97 |
98 void WmRootWindowControllerMus::ConfigureWidgetInitParamsForContainer( | 98 void WmRootWindowControllerMus::ConfigureWidgetInitParamsForContainer( |
99 views::Widget* widget, | 99 views::Widget* widget, |
(...skipping 20 matching lines...) Expand all Loading... |
120 | 120 |
121 gfx::Point WmRootWindowControllerMus::GetLastMouseLocationInRoot() { | 121 gfx::Point WmRootWindowControllerMus::GetLastMouseLocationInRoot() { |
122 gfx::Point location = root_window_controller_->window_manager() | 122 gfx::Point location = root_window_controller_->window_manager() |
123 ->window_tree_client() | 123 ->window_tree_client() |
124 ->GetCursorScreenPoint(); | 124 ->GetCursorScreenPoint(); |
125 location -= | 125 location -= |
126 root_window_controller_->display().bounds().origin().OffsetFromOrigin(); | 126 root_window_controller_->display().bounds().origin().OffsetFromOrigin(); |
127 return location; | 127 return location; |
128 } | 128 } |
129 | 129 |
| 130 bool WmRootWindowControllerMus::ShouldDestroyWindowInCloseChildWindows( |
| 131 WmWindow* window) { |
| 132 ui::Window* ui_window = WmWindowMus::GetMusWindow(window); |
| 133 return ui_window->WasCreatedByThisClient() || |
| 134 ui_window->window_tree()->GetRoots().count(ui_window); |
| 135 } |
| 136 |
130 } // namespace mus | 137 } // namespace mus |
131 } // namespace ash | 138 } // namespace ash |
OLD | NEW |