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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 if (window_id != kShellWindowId_UnparentedControlContainer) | 262 if (window_id != kShellWindowId_UnparentedControlContainer) |
263 window->Show(); | 263 window->Show(); |
264 return WmWindow::Get(window); | 264 return WmWindow::Get(window); |
265 } | 265 } |
266 | 266 |
267 // TODO(sky): This should take an aura::Window. http://crbug.com/671246. | 267 // TODO(sky): This should take an aura::Window. http://crbug.com/671246. |
268 bool ShouldDestroyWindowInCloseChildWindows(WmWindow* window) { | 268 bool ShouldDestroyWindowInCloseChildWindows(WmWindow* window) { |
269 if (!WmWindow::GetAuraWindow(window)->owned_by_parent()) | 269 if (!WmWindow::GetAuraWindow(window)->owned_by_parent()) |
270 return false; | 270 return false; |
271 | 271 |
272 if (!ShellPort::Get()->IsRunningInMash()) | 272 if (Shell::GetAshConfig() != Config::MASH) |
273 return true; | 273 return true; |
274 | 274 |
275 aura::WindowMus* window_mus = | 275 aura::WindowMus* window_mus = |
276 aura::WindowMus::Get(WmWindow::GetAuraWindow(window)); | 276 aura::WindowMus::Get(WmWindow::GetAuraWindow(window)); |
277 return Shell::window_tree_client()->WasCreatedByThisClient(window_mus) || | 277 return Shell::window_tree_client()->WasCreatedByThisClient(window_mus) || |
278 Shell::window_tree_client()->IsRoot(window_mus); | 278 Shell::window_tree_client()->IsRoot(window_mus); |
279 } | 279 } |
280 | 280 |
281 } // namespace | 281 } // namespace |
282 | 282 |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 // Clear the workspace controller, so it doesn't incorrectly update the shelf. | 619 // Clear the workspace controller, so it doesn't incorrectly update the shelf. |
620 workspace_controller_.reset(); | 620 workspace_controller_.reset(); |
621 ReparentAllWindows(GetWindow(), WmWindow::Get(dst)); | 621 ReparentAllWindows(GetWindow(), WmWindow::Get(dst)); |
622 } | 622 } |
623 | 623 |
624 void RootWindowController::UpdateShelfVisibility() { | 624 void RootWindowController::UpdateShelfVisibility() { |
625 wm_shelf_->UpdateVisibilityState(); | 625 wm_shelf_->UpdateVisibilityState(); |
626 } | 626 } |
627 | 627 |
628 void RootWindowController::InitTouchHuds() { | 628 void RootWindowController::InitTouchHuds() { |
629 if (ShellPort::Get()->IsRunningInMash()) | 629 if (Shell::GetAshConfig() == Config::MASH) |
630 return; | 630 return; |
631 | 631 |
632 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 632 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
633 if (command_line->HasSwitch(switches::kAshTouchHud)) | 633 if (command_line->HasSwitch(switches::kAshTouchHud)) |
634 set_touch_hud_debug(new TouchHudDebug(GetRootWindow())); | 634 set_touch_hud_debug(new TouchHudDebug(GetRootWindow())); |
635 if (Shell::Get()->is_touch_hud_projection_enabled()) | 635 if (Shell::Get()->is_touch_hud_projection_enabled()) |
636 EnableTouchHudProjection(); | 636 EnableTouchHudProjection(); |
637 } | 637 } |
638 | 638 |
639 aura::Window* RootWindowController::GetWindowForFullscreenMode() { | 639 aura::Window* RootWindowController::GetWindowForFullscreenMode() { |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 if (shell_port->GetPrimaryRootWindowController() | 764 if (shell_port->GetPrimaryRootWindowController() |
765 ->GetSystemModalLayoutManager(nullptr) | 765 ->GetSystemModalLayoutManager(nullptr) |
766 ->has_window_dimmer()) { | 766 ->has_window_dimmer()) { |
767 GetSystemModalLayoutManager(nullptr)->CreateModalBackground(); | 767 GetSystemModalLayoutManager(nullptr)->CreateModalBackground(); |
768 } | 768 } |
769 | 769 |
770 shell->AddShellObserver(this); | 770 shell->AddShellObserver(this); |
771 | 771 |
772 root_window_layout_manager_->OnWindowResized(); | 772 root_window_layout_manager_->OnWindowResized(); |
773 if (root_window_type == RootWindowType::PRIMARY) { | 773 if (root_window_type == RootWindowType::PRIMARY) { |
774 if (!shell_port->IsRunningInMash()) | 774 if (Shell::GetAshConfig() != Config::MASH) |
775 shell->InitKeyboard(); | 775 shell->InitKeyboard(); |
776 } else { | 776 } else { |
777 window_tree_host_->Show(); | 777 window_tree_host_->Show(); |
778 | 778 |
779 // Create a shelf if a user is already logged in. | 779 // Create a shelf if a user is already logged in. |
780 if (shell->session_controller()->NumberOfLoggedInUsers()) | 780 if (shell->session_controller()->NumberOfLoggedInUsers()) |
781 CreateShelfView(); | 781 CreateShelfView(); |
782 | 782 |
783 // Notify shell observers about new root window. | 783 // Notify shell observers about new root window. |
784 shell->OnRootWindowAdded(WmWindow::Get(root_window)); | 784 shell->OnRootWindowAdded(WmWindow::Get(root_window)); |
785 } | 785 } |
786 | 786 |
787 // TODO: AshTouchExplorationManager doesn't work with mus. | 787 // TODO: AshTouchExplorationManager doesn't work with mus. |
788 // http://crbug.com/679782 | 788 // http://crbug.com/679782 |
789 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 789 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
790 switches::kAshDisableTouchExplorationMode) && | 790 switches::kAshDisableTouchExplorationMode) && |
791 !shell_port->IsRunningInMash()) { | 791 Shell::GetAshConfig() != Config::MASH) { |
792 touch_exploration_manager_.reset(new AshTouchExplorationManager(this)); | 792 touch_exploration_manager_.reset(new AshTouchExplorationManager(this)); |
793 } | 793 } |
794 } | 794 } |
795 | 795 |
796 void RootWindowController::InitLayoutManagers() { | 796 void RootWindowController::InitLayoutManagers() { |
797 // Create the shelf and status area widgets. | 797 // Create the shelf and status area widgets. |
798 DCHECK(!wm_shelf_->shelf_widget()); | 798 DCHECK(!wm_shelf_->shelf_widget()); |
799 GetShelf()->CreateShelfWidget(GetWindow()); | 799 GetShelf()->CreateShelfWidget(GetWindow()); |
800 | 800 |
801 WmWindow* root = GetWindow(); | 801 WmWindow* root = GetWindow(); |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 EnableTouchHudProjection(); | 1101 EnableTouchHudProjection(); |
1102 else | 1102 else |
1103 DisableTouchHudProjection(); | 1103 DisableTouchHudProjection(); |
1104 } | 1104 } |
1105 | 1105 |
1106 RootWindowController* GetRootWindowController(const aura::Window* root_window) { | 1106 RootWindowController* GetRootWindowController(const aura::Window* root_window) { |
1107 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; | 1107 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; |
1108 } | 1108 } |
1109 | 1109 |
1110 } // namespace ash | 1110 } // namespace ash |
OLD | NEW |