| 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/wm/aura/wm_root_window_controller_aura.h" | 5 #include "ash/wm/aura/wm_root_window_controller_aura.h" |
| 6 | 6 |
| 7 #include "ash/display/window_tree_host_manager.h" | 7 #include "ash/display/window_tree_host_manager.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
| 10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 DECLARE_WINDOW_PROPERTY_TYPE(ash::wm::WmRootWindowControllerAura*); | 22 DECLARE_WINDOW_PROPERTY_TYPE(ash::wm::WmRootWindowControllerAura*); |
| 23 | 23 |
| 24 namespace ash { | 24 namespace ash { |
| 25 namespace wm { | 25 namespace wm { |
| 26 | 26 |
| 27 // TODO(sky): it likely makes more sense to hang this off RootWindowSettings. | 27 // TODO(sky): it likely makes more sense to hang this off RootWindowSettings. |
| 28 DEFINE_OWNED_WINDOW_PROPERTY_KEY(ash::wm::WmRootWindowControllerAura, | 28 DEFINE_OWNED_WINDOW_PROPERTY_KEY(ash::wm::WmRootWindowControllerAura, |
| 29 kWmRootWindowControllerKey, | 29 kWmRootWindowControllerKey, |
| 30 nullptr); | 30 nullptr); |
| 31 | 31 |
| 32 // static | |
| 33 WmRootWindowController* WmRootWindowController::GetWithDisplayId(int64_t id) { | |
| 34 return WmRootWindowControllerAura::Get(Shell::GetInstance() | |
| 35 ->window_tree_host_manager() | |
| 36 ->GetRootWindowForDisplayId(id)); | |
| 37 } | |
| 38 | |
| 39 WmRootWindowControllerAura::WmRootWindowControllerAura( | 32 WmRootWindowControllerAura::WmRootWindowControllerAura( |
| 40 RootWindowController* root_window_controller) | 33 RootWindowController* root_window_controller) |
| 41 : root_window_controller_(root_window_controller) { | 34 : root_window_controller_(root_window_controller) { |
| 42 root_window_controller_->GetRootWindow()->SetProperty( | 35 root_window_controller_->GetRootWindow()->SetProperty( |
| 43 kWmRootWindowControllerKey, this); | 36 kWmRootWindowControllerKey, this); |
| 44 Shell::GetInstance()->AddShellObserver(this); | 37 Shell::GetInstance()->AddShellObserver(this); |
| 45 } | 38 } |
| 46 | 39 |
| 47 WmRootWindowControllerAura::~WmRootWindowControllerAura() { | 40 WmRootWindowControllerAura::~WmRootWindowControllerAura() { |
| 48 Shell::GetInstance()->RemoveShellObserver(this); | 41 Shell::GetInstance()->RemoveShellObserver(this); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 67 | 60 |
| 68 // WmRootWindowControllerAura is owned by the RootWindowController's window. | 61 // WmRootWindowControllerAura is owned by the RootWindowController's window. |
| 69 return new WmRootWindowControllerAura(root_window_controller); | 62 return new WmRootWindowControllerAura(root_window_controller); |
| 70 } | 63 } |
| 71 | 64 |
| 72 bool WmRootWindowControllerAura::HasShelf() { | 65 bool WmRootWindowControllerAura::HasShelf() { |
| 73 return root_window_controller_->shelf() != nullptr; | 66 return root_window_controller_->shelf() != nullptr; |
| 74 } | 67 } |
| 75 | 68 |
| 76 WmGlobals* WmRootWindowControllerAura::GetGlobals() { | 69 WmGlobals* WmRootWindowControllerAura::GetGlobals() { |
| 77 return WmGlobalsAura::Get(); | 70 return WmGlobals::Get(); |
| 78 } | 71 } |
| 79 | 72 |
| 80 WorkspaceWindowState WmRootWindowControllerAura::GetWorkspaceWindowState() { | 73 WorkspaceWindowState WmRootWindowControllerAura::GetWorkspaceWindowState() { |
| 81 return root_window_controller_->workspace_controller()->GetWindowState(); | 74 return root_window_controller_->workspace_controller()->GetWindowState(); |
| 82 } | 75 } |
| 83 | 76 |
| 84 AlwaysOnTopController* WmRootWindowControllerAura::GetAlwaysOnTopController() { | 77 AlwaysOnTopController* WmRootWindowControllerAura::GetAlwaysOnTopController() { |
| 85 return root_window_controller_->always_on_top_controller(); | 78 return root_window_controller_->always_on_top_controller(); |
| 86 } | 79 } |
| 87 | 80 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 aura::Window* root_window) { | 139 aura::Window* root_window) { |
| 147 if (root_window != root_window_controller_->GetRootWindow()) | 140 if (root_window != root_window_controller_->GetRootWindow()) |
| 148 return; | 141 return; |
| 149 | 142 |
| 150 FOR_EACH_OBSERVER(WmRootWindowControllerObserver, observers_, | 143 FOR_EACH_OBSERVER(WmRootWindowControllerObserver, observers_, |
| 151 OnShelfAlignmentChanged()); | 144 OnShelfAlignmentChanged()); |
| 152 } | 145 } |
| 153 | 146 |
| 154 } // namespace wm | 147 } // namespace wm |
| 155 } // namespace ash | 148 } // namespace ash |
| OLD | NEW |