| 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 bool RootWindowController::IsVirtualKeyboardWindow(aura::Window* window) { | 648 bool RootWindowController::IsVirtualKeyboardWindow(aura::Window* window) { |
| 649 aura::Window* parent = GetContainer(kShellWindowId_ImeWindowParentContainer); | 649 aura::Window* parent = GetContainer(kShellWindowId_ImeWindowParentContainer); |
| 650 return parent ? parent->Contains(window) : false; | 650 return parent ? parent->Contains(window) : false; |
| 651 } | 651 } |
| 652 | 652 |
| 653 //////////////////////////////////////////////////////////////////////////////// | 653 //////////////////////////////////////////////////////////////////////////////// |
| 654 // RootWindowController, private: | 654 // RootWindowController, private: |
| 655 | 655 |
| 656 RootWindowController::RootWindowController(AshWindowTreeHost* ash_host) | 656 RootWindowController::RootWindowController(AshWindowTreeHost* ash_host) |
| 657 : ash_host_(ash_host), | 657 : ash_host_(ash_host), |
| 658 root_window_layout_(NULL), | |
| 659 docked_layout_manager_(NULL), | 658 docked_layout_manager_(NULL), |
| 660 panel_layout_manager_(NULL), | 659 panel_layout_manager_(NULL), |
| 661 touch_hud_debug_(NULL), | 660 touch_hud_debug_(NULL), |
| 662 touch_hud_projection_(NULL) { | 661 touch_hud_projection_(NULL) { |
| 663 aura::Window* root_window = GetRootWindow(); | 662 aura::Window* root_window = GetRootWindow(); |
| 664 root_window_controller_common_.reset( | 663 root_window_controller_common_.reset( |
| 665 new RootWindowControllerCommon(wm::WmWindowAura::Get(root_window))); | 664 new RootWindowControllerCommon(wm::WmWindowAura::Get(root_window))); |
| 666 GetRootWindowSettings(root_window)->controller = this; | 665 GetRootWindowSettings(root_window)->controller = this; |
| 667 | 666 |
| 668 stacking_controller_.reset(new StackingController); | 667 stacking_controller_.reset(new StackingController); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 683 InitLayoutManagers(); | 682 InitLayoutManagers(); |
| 684 InitTouchHuds(); | 683 InitTouchHuds(); |
| 685 | 684 |
| 686 if (Shell::GetPrimaryRootWindowController()-> | 685 if (Shell::GetPrimaryRootWindowController()-> |
| 687 GetSystemModalLayoutManager(NULL)->has_modal_background()) { | 686 GetSystemModalLayoutManager(NULL)->has_modal_background()) { |
| 688 GetSystemModalLayoutManager(NULL)->CreateModalBackground(); | 687 GetSystemModalLayoutManager(NULL)->CreateModalBackground(); |
| 689 } | 688 } |
| 690 | 689 |
| 691 shell->AddShellObserver(this); | 690 shell->AddShellObserver(this); |
| 692 | 691 |
| 692 root_window_controller_common_->root_window_layout()->OnWindowResized(); |
| 693 if (root_window_type == PRIMARY) { | 693 if (root_window_type == PRIMARY) { |
| 694 root_window_layout()->OnWindowResized(); | |
| 695 shell->InitKeyboard(); | 694 shell->InitKeyboard(); |
| 696 } else { | 695 } else { |
| 697 root_window_layout()->OnWindowResized(); | |
| 698 ash_host_->AsWindowTreeHost()->Show(); | 696 ash_host_->AsWindowTreeHost()->Show(); |
| 699 | 697 |
| 700 // Create a shelf if a user is already logged in. | 698 // Create a shelf if a user is already logged in. |
| 701 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) | 699 if (shell->session_state_delegate()->NumberOfLoggedInUsers()) |
| 702 CreateShelf(); | 700 CreateShelf(); |
| 703 | 701 |
| 704 // Notify shell observers about new root window. | 702 // Notify shell observers about new root window. |
| 705 shell->OnRootWindowAdded(root_window); | 703 shell->OnRootWindowAdded(root_window); |
| 706 } | 704 } |
| 707 | 705 |
| 708 #if defined(OS_CHROMEOS) | 706 #if defined(OS_CHROMEOS) |
| 709 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 707 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 710 switches::kAshDisableTouchExplorationMode)) { | 708 switches::kAshDisableTouchExplorationMode)) { |
| 711 touch_exploration_manager_.reset(new AshTouchExplorationManager(this)); | 709 touch_exploration_manager_.reset(new AshTouchExplorationManager(this)); |
| 712 } | 710 } |
| 713 #endif | 711 #endif |
| 714 } | 712 } |
| 715 | 713 |
| 716 void RootWindowController::InitLayoutManagers() { | 714 void RootWindowController::InitLayoutManagers() { |
| 715 root_window_controller_common_->CreateLayoutManagers(); |
| 716 |
| 717 aura::Window* root_window = GetRootWindow(); | 717 aura::Window* root_window = GetRootWindow(); |
| 718 root_window_layout_ = new RootWindowLayoutManager(root_window); | |
| 719 root_window->SetLayoutManager(root_window_layout_); | |
| 720 | 718 |
| 721 aura::Window* default_container = | 719 aura::Window* default_container = |
| 722 GetContainer(kShellWindowId_DefaultContainer); | 720 GetContainer(kShellWindowId_DefaultContainer); |
| 723 // Workspace manager has its own layout managers. | 721 // Workspace manager has its own layout managers. |
| 724 | 722 |
| 725 aura::Window* modal_container = | 723 aura::Window* modal_container = |
| 726 root_window->GetChildById(kShellWindowId_SystemModalContainer); | 724 root_window->GetChildById(kShellWindowId_SystemModalContainer); |
| 727 DCHECK(modal_container); | 725 DCHECK(modal_container); |
| 728 modal_container->SetLayoutManager( | 726 modal_container->SetLayoutManager( |
| 729 new SystemModalContainerLayoutManager(modal_container)); | 727 new SystemModalContainerLayoutManager(modal_container)); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 aura::Window* primary_root_window = Shell::GetInstance() | 875 aura::Window* primary_root_window = Shell::GetInstance() |
| 878 ->window_tree_host_manager() | 876 ->window_tree_host_manager() |
| 879 ->GetPrimaryRootWindow(); | 877 ->GetPrimaryRootWindow(); |
| 880 return GetRootWindowSettings(primary_root_window)->controller; | 878 return GetRootWindowSettings(primary_root_window)->controller; |
| 881 } | 879 } |
| 882 | 880 |
| 883 return GetRootWindowSettings(root_window)->controller; | 881 return GetRootWindowSettings(root_window)->controller; |
| 884 } | 882 } |
| 885 | 883 |
| 886 } // namespace ash | 884 } // namespace ash |
| OLD | NEW |