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/shell.h" | 5 #include "ash/shell.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/app_list/app_list.h" | 9 #include "ash/app_list/app_list.h" |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 } | 729 } |
730 | 730 |
731 //////////////////////////////////////////////////////////////////////////////// | 731 //////////////////////////////////////////////////////////////////////////////// |
732 // Shell, private: | 732 // Shell, private: |
733 | 733 |
734 void Shell::InitLayoutManagers() { | 734 void Shell::InitLayoutManagers() { |
735 DCHECK(root_window_layout_); | 735 DCHECK(root_window_layout_); |
736 DCHECK(status_widget_); | 736 DCHECK(status_widget_); |
737 | 737 |
738 internal::ShelfLayoutManager* shelf_layout_manager = | 738 internal::ShelfLayoutManager* shelf_layout_manager = |
739 new internal::ShelfLayoutManager(launcher_->widget(), status_widget_); | 739 new internal::ShelfLayoutManager(status_widget_); |
| 740 shelf_layout_manager->SetLauncher(launcher_.get()); |
740 GetContainer(internal::kShellWindowId_LauncherContainer)-> | 741 GetContainer(internal::kShellWindowId_LauncherContainer)-> |
741 SetLayoutManager(shelf_layout_manager); | 742 SetLayoutManager(shelf_layout_manager); |
742 shelf_ = shelf_layout_manager; | 743 shelf_ = shelf_layout_manager; |
743 | 744 |
744 internal::StatusAreaLayoutManager* status_area_layout_manager = | 745 internal::StatusAreaLayoutManager* status_area_layout_manager = |
745 new internal::StatusAreaLayoutManager(shelf_layout_manager); | 746 new internal::StatusAreaLayoutManager(shelf_layout_manager); |
746 GetContainer(internal::kShellWindowId_StatusContainer)-> | 747 GetContainer(internal::kShellWindowId_StatusContainer)-> |
747 SetLayoutManager(status_area_layout_manager); | 748 SetLayoutManager(status_area_layout_manager); |
748 | 749 |
749 aura::Window* default_container = | 750 aura::Window* default_container = |
750 GetContainer(internal::kShellWindowId_DefaultContainer); | 751 GetContainer(internal::kShellWindowId_DefaultContainer); |
751 // Workspace manager has its own layout managers. | 752 // Workspace manager has its own layout managers. |
752 workspace_controller_.reset( | 753 workspace_controller_.reset( |
753 new internal::WorkspaceController(default_container)); | 754 new internal::WorkspaceController(default_container)); |
754 workspace_controller_->workspace_manager()->set_shelf(shelf_layout_manager); | 755 workspace_controller_->workspace_manager()->set_shelf(shelf_layout_manager); |
755 | 756 |
756 // Ensure launcher is visible. | 757 // Ensure launcher is visible. |
757 launcher_->widget()->Show(); | 758 launcher_->widget()->Show(); |
758 | 759 |
759 // Create the desktop background image. | 760 // Create the desktop background image. |
760 desktop_background_controller_->SetDefaultDesktopBackgroundImage(); | 761 desktop_background_controller_->SetDefaultDesktopBackgroundImage(); |
761 } | 762 } |
762 | 763 |
763 void Shell::DisableWorkspaceGridLayout() { | 764 void Shell::DisableWorkspaceGridLayout() { |
764 if (workspace_controller_.get()) | 765 if (workspace_controller_.get()) |
765 workspace_controller_->workspace_manager()->set_grid_size(0); | 766 workspace_controller_->workspace_manager()->set_grid_size(0); |
766 } | 767 } |
767 | 768 |
768 } // namespace ash | 769 } // namespace ash |
OLD | NEW |