| 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/root_window_controller.h" | 10 #include "ash/mus/root_window_controller.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 gfx::Point WmRootWindowControllerMus::ConvertPointToScreen( | 56 gfx::Point WmRootWindowControllerMus::ConvertPointToScreen( |
| 57 const WmWindowMus* source, | 57 const WmWindowMus* source, |
| 58 const gfx::Point& point) const { | 58 const gfx::Point& point) const { |
| 59 gfx::Point point_in_root = | 59 gfx::Point point_in_root = |
| 60 source->ConvertPointToTarget(source->GetRootWindow(), point); | 60 source->ConvertPointToTarget(source->GetRootWindow(), point); |
| 61 point_in_root += GetDisplay().bounds().OffsetFromOrigin(); | 61 point_in_root += GetDisplay().bounds().OffsetFromOrigin(); |
| 62 return point_in_root; | 62 return point_in_root; |
| 63 } | 63 } |
| 64 | 64 |
| 65 gfx::Point WmRootWindowControllerMus::ConvertPointFromScreen( | |
| 66 const WmWindowMus* target, | |
| 67 const gfx::Point& point) const { | |
| 68 gfx::Point result = point; | |
| 69 result -= GetDisplay().bounds().OffsetFromOrigin(); | |
| 70 return target->GetRootWindow()->ConvertPointToTarget(target, result); | |
| 71 } | |
| 72 | |
| 73 const display::Display& WmRootWindowControllerMus::GetDisplay() const { | 65 const display::Display& WmRootWindowControllerMus::GetDisplay() const { |
| 74 return root_window_controller_->display(); | 66 return root_window_controller_->display(); |
| 75 } | 67 } |
| 76 | 68 |
| 77 void WmRootWindowControllerMus::MoveWindowsTo(WmWindow* dest) { | 69 void WmRootWindowControllerMus::MoveWindowsTo(WmWindow* dest) { |
| 78 WmRootWindowController::MoveWindowsTo(dest); | 70 WmRootWindowController::MoveWindowsTo(dest); |
| 79 } | 71 } |
| 80 | 72 |
| 81 bool WmRootWindowControllerMus::HasShelf() { | 73 bool WmRootWindowControllerMus::HasShelf() { |
| 82 return GetShelf() != nullptr; | 74 return GetShelf() != nullptr; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 aura::WindowTreeClient* window_tree_client = | 116 aura::WindowTreeClient* window_tree_client = |
| 125 root_window_controller_->window_manager()->window_tree_client(); | 117 root_window_controller_->window_manager()->window_tree_client(); |
| 126 aura::Window* aura_window = WmWindowMus::GetAuraWindow(window); | 118 aura::Window* aura_window = WmWindowMus::GetAuraWindow(window); |
| 127 aura::WindowMus* window_mus = aura::WindowMus::Get(aura_window); | 119 aura::WindowMus* window_mus = aura::WindowMus::Get(aura_window); |
| 128 return window_tree_client->WasCreatedByThisClient(window_mus) || | 120 return window_tree_client->WasCreatedByThisClient(window_mus) || |
| 129 window_tree_client->IsRoot(window_mus); | 121 window_tree_client->IsRoot(window_mus); |
| 130 } | 122 } |
| 131 | 123 |
| 132 } // namespace mus | 124 } // namespace mus |
| 133 } // namespace ash | 125 } // namespace ash |
| OLD | NEW |