| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 #include "ash/wm/window_util.h" | 59 #include "ash/wm/window_util.h" |
| 60 #include "base/command_line.h" | 60 #include "base/command_line.h" |
| 61 #include "base/macros.h" | 61 #include "base/macros.h" |
| 62 #include "base/memory/ptr_util.h" | 62 #include "base/memory/ptr_util.h" |
| 63 #include "base/time/time.h" | 63 #include "base/time/time.h" |
| 64 #include "chromeos/chromeos_switches.h" | 64 #include "chromeos/chromeos_switches.h" |
| 65 #include "ui/aura/client/aura_constants.h" | 65 #include "ui/aura/client/aura_constants.h" |
| 66 #include "ui/aura/client/drag_drop_client.h" | 66 #include "ui/aura/client/drag_drop_client.h" |
| 67 #include "ui/aura/client/screen_position_client.h" | 67 #include "ui/aura/client/screen_position_client.h" |
| 68 #include "ui/aura/mus/window_mus.h" | 68 #include "ui/aura/mus/window_mus.h" |
| 69 #include "ui/aura/mus/window_port_mus.h" |
| 69 #include "ui/aura/mus/window_tree_client.h" | 70 #include "ui/aura/mus/window_tree_client.h" |
| 70 #include "ui/aura/window.h" | 71 #include "ui/aura/window.h" |
| 71 #include "ui/aura/window_event_dispatcher.h" | 72 #include "ui/aura/window_event_dispatcher.h" |
| 72 #include "ui/aura/window_observer.h" | 73 #include "ui/aura/window_observer.h" |
| 73 #include "ui/aura/window_tracker.h" | 74 #include "ui/aura/window_tracker.h" |
| 74 #include "ui/base/models/menu_model.h" | 75 #include "ui/base/models/menu_model.h" |
| 75 #include "ui/chromeos/touch_exploration_controller.h" | 76 #include "ui/chromeos/touch_exploration_controller.h" |
| 76 #include "ui/display/types/display_constants.h" | 77 #include "ui/display/types/display_constants.h" |
| 77 #include "ui/events/event_utils.h" | 78 #include "ui/events/event_utils.h" |
| 78 #include "ui/keyboard/keyboard_controller.h" | 79 #include "ui/keyboard/keyboard_controller.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 ReparentWindow(*iter, dst_container); | 242 ReparentWindow(*iter, dst_container); |
| 242 } | 243 } |
| 243 } | 244 } |
| 244 } | 245 } |
| 245 | 246 |
| 246 // Creates a new window for use as a container. | 247 // Creates a new window for use as a container. |
| 247 // TODO(sky): This should create an aura::Window. http://crbug.com/671246. | 248 // TODO(sky): This should create an aura::Window. http://crbug.com/671246. |
| 248 WmWindow* CreateContainer(int window_id, const char* name, WmWindow* parent) { | 249 WmWindow* CreateContainer(int window_id, const char* name, WmWindow* parent) { |
| 249 WmWindow* window = WmShell::Get()->NewWindow(ui::wm::WINDOW_TYPE_UNKNOWN, | 250 WmWindow* window = WmShell::Get()->NewWindow(ui::wm::WINDOW_TYPE_UNKNOWN, |
| 250 ui::LAYER_NOT_DRAWN); | 251 ui::LAYER_NOT_DRAWN); |
| 252 if (WmShell::Get()->IsRunningInMash()) { |
| 253 aura::WindowPortMus::Get(window->aura_window()) |
| 254 ->SetEventTargetingPolicy( |
| 255 ui::mojom::EventTargetingPolicy::DESCENDANTS_ONLY); |
| 256 } |
| 251 window->SetShellWindowId(window_id); | 257 window->SetShellWindowId(window_id); |
| 252 window->SetName(name); | 258 window->SetName(name); |
| 253 parent->AddChild(window); | 259 parent->AddChild(window); |
| 254 if (window_id != kShellWindowId_UnparentedControlContainer) | 260 if (window_id != kShellWindowId_UnparentedControlContainer) |
| 255 window->Show(); | 261 window->Show(); |
| 256 return window; | 262 return window; |
| 257 } | 263 } |
| 258 | 264 |
| 259 // TODO(sky): This should take an aura::Window. http://crbug.com/671246. | 265 // TODO(sky): This should take an aura::Window. http://crbug.com/671246. |
| 260 bool ShouldDestroyWindowInCloseChildWindows(WmWindow* window) { | 266 bool ShouldDestroyWindowInCloseChildWindows(WmWindow* window) { |
| (...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 EnableTouchHudProjection(); | 1148 EnableTouchHudProjection(); |
| 1143 else | 1149 else |
| 1144 DisableTouchHudProjection(); | 1150 DisableTouchHudProjection(); |
| 1145 } | 1151 } |
| 1146 | 1152 |
| 1147 RootWindowController* GetRootWindowController(const aura::Window* root_window) { | 1153 RootWindowController* GetRootWindowController(const aura::Window* root_window) { |
| 1148 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; | 1154 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; |
| 1149 } | 1155 } |
| 1150 | 1156 |
| 1151 } // namespace ash | 1157 } // namespace ash |
| OLD | NEW |