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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 internal::MagnificationController::CreateInstance()); | 450 internal::MagnificationController::CreateInstance()); |
451 | 451 |
452 if (internal::DisplayController::IsExtendedDesktopEnabled()) { | 452 if (internal::DisplayController::IsExtendedDesktopEnabled()) { |
453 mouse_cursor_filter_.reset( | 453 mouse_cursor_filter_.reset( |
454 new internal::MouseCursorEventFilter(display_controller_.get())); | 454 new internal::MouseCursorEventFilter(display_controller_.get())); |
455 AddEnvEventFilter(mouse_cursor_filter_.get()); | 455 AddEnvEventFilter(mouse_cursor_filter_.get()); |
456 } | 456 } |
457 | 457 |
458 high_contrast_controller_.reset(new HighContrastController); | 458 high_contrast_controller_.reset(new HighContrastController); |
459 video_detector_.reset(new VideoDetector); | 459 video_detector_.reset(new VideoDetector); |
460 window_cycle_controller_.reset(new WindowCycleController); | 460 window_cycle_controller_.reset( |
| 461 new WindowCycleController(activation_controller_.get())); |
461 | 462 |
462 tooltip_controller_.reset(new internal::TooltipController( | 463 tooltip_controller_.reset(new internal::TooltipController( |
463 drag_drop_controller_.get())); | 464 drag_drop_controller_.get())); |
464 AddEnvEventFilter(tooltip_controller_.get()); | 465 AddEnvEventFilter(tooltip_controller_.get()); |
465 | 466 |
466 InitRootWindowController(root_window_controller); | 467 InitRootWindowController(root_window_controller); |
467 | 468 |
468 // Initialize Primary RootWindow specific items. | 469 // Initialize Primary RootWindow specific items. |
469 status_area_widget_ = new internal::StatusAreaWidget(); | 470 status_area_widget_ = new internal::StatusAreaWidget(); |
470 status_area_widget_->CreateTrayViews(delegate_.get()); | 471 status_area_widget_->CreateTrayViews(delegate_.get()); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 } | 698 } |
698 } | 699 } |
699 | 700 |
700 void Shell::InitRootWindowController( | 701 void Shell::InitRootWindowController( |
701 internal::RootWindowController* controller) { | 702 internal::RootWindowController* controller) { |
702 aura::RootWindow* root_window = controller->root_window(); | 703 aura::RootWindow* root_window = controller->root_window(); |
703 DCHECK(activation_controller_.get()); | 704 DCHECK(activation_controller_.get()); |
704 DCHECK(visibility_controller_.get()); | 705 DCHECK(visibility_controller_.get()); |
705 DCHECK(drag_drop_controller_.get()); | 706 DCHECK(drag_drop_controller_.get()); |
706 DCHECK(capture_controller_.get()); | 707 DCHECK(capture_controller_.get()); |
| 708 DCHECK(window_cycle_controller_.get()); |
707 | 709 |
708 root_window->set_focus_manager(focus_manager_.get()); | 710 root_window->set_focus_manager(focus_manager_.get()); |
709 input_method_filter_->SetInputMethodPropertyInRootWindow(root_window); | 711 input_method_filter_->SetInputMethodPropertyInRootWindow(root_window); |
710 aura::client::SetActivationClient(root_window, activation_controller_.get()); | 712 aura::client::SetActivationClient(root_window, activation_controller_.get()); |
711 aura::client::SetVisibilityClient(root_window, visibility_controller_.get()); | 713 aura::client::SetVisibilityClient(root_window, visibility_controller_.get()); |
712 aura::client::SetDragDropClient(root_window, drag_drop_controller_.get()); | 714 aura::client::SetDragDropClient(root_window, drag_drop_controller_.get()); |
713 aura::client::SetCaptureClient(root_window, capture_controller_.get()); | 715 aura::client::SetCaptureClient(root_window, capture_controller_.get()); |
714 aura::client::SetScreenPositionClient(root_window, | 716 aura::client::SetScreenPositionClient(root_window, |
715 screen_position_controller_.get()); | 717 screen_position_controller_.get()); |
716 aura::client::SetCursorClient(root_window, &cursor_manager_); | 718 aura::client::SetCursorClient(root_window, &cursor_manager_); |
(...skipping 11 matching lines...) Expand all Loading... |
728 | 730 |
729 // TODO(oshima): Move the instance to RootWindowController when | 731 // TODO(oshima): Move the instance to RootWindowController when |
730 // the extended desktop is enabled by default. | 732 // the extended desktop is enabled by default. |
731 internal::AlwaysOnTopController* always_on_top_controller = | 733 internal::AlwaysOnTopController* always_on_top_controller = |
732 new internal::AlwaysOnTopController; | 734 new internal::AlwaysOnTopController; |
733 always_on_top_controller->SetContainers( | 735 always_on_top_controller->SetContainers( |
734 root_window->GetChildById(internal::kShellWindowId_DefaultContainer), | 736 root_window->GetChildById(internal::kShellWindowId_DefaultContainer), |
735 root_window->GetChildById(internal::kShellWindowId_AlwaysOnTopContainer)); | 737 root_window->GetChildById(internal::kShellWindowId_AlwaysOnTopContainer)); |
736 root_window->SetProperty(internal::kAlwaysOnTopControllerKey, | 738 root_window->SetProperty(internal::kAlwaysOnTopControllerKey, |
737 always_on_top_controller); | 739 always_on_top_controller); |
| 740 |
| 741 window_cycle_controller_->OnRootWindowAdded(root_window); |
738 } | 742 } |
739 | 743 |
740 //////////////////////////////////////////////////////////////////////////////// | 744 //////////////////////////////////////////////////////////////////////////////// |
741 // Shell, private: | 745 // Shell, private: |
742 | 746 |
743 void Shell::InitLayoutManagersForPrimaryDisplay( | 747 void Shell::InitLayoutManagersForPrimaryDisplay( |
744 internal::RootWindowController* controller) { | 748 internal::RootWindowController* controller) { |
745 DCHECK(status_area_widget_); | 749 DCHECK(status_area_widget_); |
746 | 750 |
747 internal::ShelfLayoutManager* shelf_layout_manager = | 751 internal::ShelfLayoutManager* shelf_layout_manager = |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 } | 793 } |
790 | 794 |
791 void Shell::ShowCursor(bool visible) { | 795 void Shell::ShowCursor(bool visible) { |
792 RootWindowList root_windows = GetAllRootWindows(); | 796 RootWindowList root_windows = GetAllRootWindows(); |
793 for (RootWindowList::iterator iter = root_windows.begin(); | 797 for (RootWindowList::iterator iter = root_windows.begin(); |
794 iter != root_windows.end(); ++iter) | 798 iter != root_windows.end(); ++iter) |
795 (*iter)->ShowCursor(visible); | 799 (*iter)->ShowCursor(visible); |
796 } | 800 } |
797 | 801 |
798 } // namespace ash | 802 } // namespace ash |
OLD | NEW |