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 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/accelerators/focus_manager_factory.h" | 10 #include "ash/accelerators/focus_manager_factory.h" |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 } | 694 } |
695 } | 695 } |
696 | 696 |
697 void Shell::InitRootWindowController( | 697 void Shell::InitRootWindowController( |
698 internal::RootWindowController* controller) { | 698 internal::RootWindowController* controller) { |
699 aura::RootWindow* root_window = controller->root_window(); | 699 aura::RootWindow* root_window = controller->root_window(); |
700 DCHECK(activation_controller_.get()); | 700 DCHECK(activation_controller_.get()); |
701 DCHECK(visibility_controller_.get()); | 701 DCHECK(visibility_controller_.get()); |
702 DCHECK(drag_drop_controller_.get()); | 702 DCHECK(drag_drop_controller_.get()); |
703 DCHECK(capture_controller_.get()); | 703 DCHECK(capture_controller_.get()); |
| 704 DCHECK(window_cycle_controller_.get()); |
704 | 705 |
705 root_window->set_focus_manager(focus_manager_.get()); | 706 root_window->set_focus_manager(focus_manager_.get()); |
706 input_method_filter_->SetInputMethodPropertyInRootWindow(root_window); | 707 input_method_filter_->SetInputMethodPropertyInRootWindow(root_window); |
707 aura::client::SetActivationClient(root_window, activation_controller_.get()); | 708 aura::client::SetActivationClient(root_window, activation_controller_.get()); |
708 aura::client::SetVisibilityClient(root_window, visibility_controller_.get()); | 709 aura::client::SetVisibilityClient(root_window, visibility_controller_.get()); |
709 aura::client::SetDragDropClient(root_window, drag_drop_controller_.get()); | 710 aura::client::SetDragDropClient(root_window, drag_drop_controller_.get()); |
710 aura::client::SetCaptureClient(root_window, capture_controller_.get()); | 711 aura::client::SetCaptureClient(root_window, capture_controller_.get()); |
711 aura::client::SetScreenPositionClient(root_window, | 712 aura::client::SetScreenPositionClient(root_window, |
712 screen_position_controller_.get()); | 713 screen_position_controller_.get()); |
713 | 714 |
714 if (nested_dispatcher_controller_.get()) { | 715 if (nested_dispatcher_controller_.get()) { |
715 aura::client::SetDispatcherClient(root_window, | 716 aura::client::SetDispatcherClient(root_window, |
716 nested_dispatcher_controller_.get()); | 717 nested_dispatcher_controller_.get()); |
717 } | 718 } |
718 if (user_action_client_.get()) | 719 if (user_action_client_.get()) |
719 aura::client::SetUserActionClient(root_window, user_action_client_.get()); | 720 aura::client::SetUserActionClient(root_window, user_action_client_.get()); |
720 | 721 |
721 root_window->SetCursor(ui::kCursorPointer); | 722 root_window->SetCursor(ui::kCursorPointer); |
722 controller->InitLayoutManagers(); | 723 controller->InitLayoutManagers(); |
723 | 724 |
724 // TODO(oshima): Move the instance to RootWindowController when | 725 // TODO(oshima): Move the instance to RootWindowController when |
725 // the extended desktop is enabled by default. | 726 // the extended desktop is enabled by default. |
726 internal::AlwaysOnTopController* always_on_top_controller = | 727 internal::AlwaysOnTopController* always_on_top_controller = |
727 new internal::AlwaysOnTopController; | 728 new internal::AlwaysOnTopController; |
728 always_on_top_controller->SetContainers( | 729 always_on_top_controller->SetContainers( |
729 root_window->GetChildById(internal::kShellWindowId_DefaultContainer), | 730 root_window->GetChildById(internal::kShellWindowId_DefaultContainer), |
730 root_window->GetChildById(internal::kShellWindowId_AlwaysOnTopContainer)); | 731 root_window->GetChildById(internal::kShellWindowId_AlwaysOnTopContainer)); |
731 root_window->SetProperty(internal::kAlwaysOnTopControllerKey, | 732 root_window->SetProperty(internal::kAlwaysOnTopControllerKey, |
732 always_on_top_controller); | 733 always_on_top_controller); |
| 734 |
| 735 window_cycle_controller_->OnRootWindowAdded(root_window); |
733 } | 736 } |
734 | 737 |
735 //////////////////////////////////////////////////////////////////////////////// | 738 //////////////////////////////////////////////////////////////////////////////// |
736 // Shell, private: | 739 // Shell, private: |
737 | 740 |
738 void Shell::InitLayoutManagersForPrimaryDisplay( | 741 void Shell::InitLayoutManagersForPrimaryDisplay( |
739 internal::RootWindowController* controller) { | 742 internal::RootWindowController* controller) { |
740 DCHECK(status_area_widget_); | 743 DCHECK(status_area_widget_); |
741 | 744 |
742 internal::ShelfLayoutManager* shelf_layout_manager = | 745 internal::ShelfLayoutManager* shelf_layout_manager = |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 } | 787 } |
785 | 788 |
786 void Shell::ShowCursor(bool visible) { | 789 void Shell::ShowCursor(bool visible) { |
787 RootWindowList root_windows = GetAllRootWindows(); | 790 RootWindowList root_windows = GetAllRootWindows(); |
788 for (RootWindowList::iterator iter = root_windows.begin(); | 791 for (RootWindowList::iterator iter = root_windows.begin(); |
789 iter != root_windows.end(); ++iter) | 792 iter != root_windows.end(); ++iter) |
790 (*iter)->ShowCursor(visible); | 793 (*iter)->ShowCursor(visible); |
791 } | 794 } |
792 | 795 |
793 } // namespace ash | 796 } // namespace ash |
OLD | NEW |