| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
| (...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 | 1049 |
| 1050 void RootWindowController::OnTouchHudProjectionToggled(bool enabled) { | 1050 void RootWindowController::OnTouchHudProjectionToggled(bool enabled) { |
| 1051 if (enabled) | 1051 if (enabled) |
| 1052 EnableTouchHudProjection(); | 1052 EnableTouchHudProjection(); |
| 1053 else | 1053 else |
| 1054 DisableTouchHudProjection(); | 1054 DisableTouchHudProjection(); |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 RootWindowController* GetRootWindowController( | 1057 RootWindowController* GetRootWindowController( |
| 1058 const aura::Window* root_window) { | 1058 const aura::Window* root_window) { |
| 1059 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 1059 if (!root_window) |
| 1060 return nullptr; |
| 1061 |
| 1062 if (Shell::GetInstance()->in_mus()) { |
| 1063 // On mus, like desktop aura, each top-level widget has its own root window, |
| 1064 // so |root_window| is not necessarily the display's root. For now, just |
| 1065 // the use the primary display root. |
| 1066 // TODO(jamescook): Multi-display support. This depends on how mus windows |
| 1067 // will be owned by displays. |
| 1068 aura::Window* primary_root_window = Shell::GetInstance() |
| 1069 ->window_tree_host_manager() |
| 1070 ->GetPrimaryRootWindow(); |
| 1071 return GetRootWindowSettings(primary_root_window)->controller; |
| 1072 } |
| 1073 |
| 1074 return GetRootWindowSettings(root_window)->controller; |
| 1060 } | 1075 } |
| 1061 | 1076 |
| 1062 } // namespace ash | 1077 } // namespace ash |
| OLD | NEW |