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/accelerator_controller.h" | 10 #include "ash/accelerators/accelerator_controller.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 #include "ui/wm/core/window_modality_controller.h" | 111 #include "ui/wm/core/window_modality_controller.h" |
112 | 112 |
113 #if defined(OS_CHROMEOS) | 113 #if defined(OS_CHROMEOS) |
114 #if defined(USE_X11) | 114 #if defined(USE_X11) |
115 #include "ash/accelerators/magnifier_key_scroller.h" | 115 #include "ash/accelerators/magnifier_key_scroller.h" |
116 #include "ash/accelerators/spoken_feedback_toggler.h" | 116 #include "ash/accelerators/spoken_feedback_toggler.h" |
117 #include "ui/gfx/x/x11_types.h" | 117 #include "ui/gfx/x/x11_types.h" |
118 #endif // defined(USE_X11) | 118 #endif // defined(USE_X11) |
119 #include "ash/ash_constants.h" | 119 #include "ash/ash_constants.h" |
120 #include "ash/display/display_change_observer_chromeos.h" | 120 #include "ash/display/display_change_observer_chromeos.h" |
| 121 #include "ash/display/display_configurator_animation.h" |
121 #include "ash/display/display_error_observer_chromeos.h" | 122 #include "ash/display/display_error_observer_chromeos.h" |
122 #include "ash/display/output_configurator_animation.h" | |
123 #include "ash/display/projecting_observer_chromeos.h" | 123 #include "ash/display/projecting_observer_chromeos.h" |
124 #include "ash/display/resolution_notification_controller.h" | 124 #include "ash/display/resolution_notification_controller.h" |
125 #include "ash/sticky_keys/sticky_keys_controller.h" | 125 #include "ash/sticky_keys/sticky_keys_controller.h" |
126 #include "ash/system/chromeos/bluetooth/bluetooth_notification_controller.h" | 126 #include "ash/system/chromeos/bluetooth/bluetooth_notification_controller.h" |
127 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h" | 127 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h" |
128 #include "ash/system/chromeos/power/power_event_observer.h" | 128 #include "ash/system/chromeos/power/power_event_observer.h" |
129 #include "ash/system/chromeos/power/power_status.h" | 129 #include "ash/system/chromeos/power/power_status.h" |
130 #include "ash/system/chromeos/power/video_activity_notifier.h" | 130 #include "ash/system/chromeos/power/video_activity_notifier.h" |
131 #include "ash/system/chromeos/session/last_window_closed_logout_reminder.h" | 131 #include "ash/system/chromeos/session/last_window_closed_logout_reminder.h" |
132 #include "ash/system/chromeos/session/logout_confirmation_controller.h" | 132 #include "ash/system/chromeos/session/logout_confirmation_controller.h" |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 screen_position_controller_.reset(); | 765 screen_position_controller_.reset(); |
766 accessibility_delegate_.reset(); | 766 accessibility_delegate_.reset(); |
767 new_window_delegate_.reset(); | 767 new_window_delegate_.reset(); |
768 media_delegate_.reset(); | 768 media_delegate_.reset(); |
769 | 769 |
770 keyboard::KeyboardController::ResetInstance(NULL); | 770 keyboard::KeyboardController::ResetInstance(NULL); |
771 | 771 |
772 #if defined(OS_CHROMEOS) | 772 #if defined(OS_CHROMEOS) |
773 if (display_change_observer_) | 773 if (display_change_observer_) |
774 display_configurator_->RemoveObserver(display_change_observer_.get()); | 774 display_configurator_->RemoveObserver(display_change_observer_.get()); |
775 if (output_configurator_animation_) | 775 if (display_configurator_animation_) |
776 display_configurator_->RemoveObserver(output_configurator_animation_.get()); | 776 display_configurator_->RemoveObserver( |
| 777 display_configurator_animation_.get()); |
777 if (display_error_observer_) | 778 if (display_error_observer_) |
778 display_configurator_->RemoveObserver(display_error_observer_.get()); | 779 display_configurator_->RemoveObserver(display_error_observer_.get()); |
779 if (projecting_observer_) | 780 if (projecting_observer_) |
780 display_configurator_->RemoveObserver(projecting_observer_.get()); | 781 display_configurator_->RemoveObserver(projecting_observer_.get()); |
781 display_change_observer_.reset(); | 782 display_change_observer_.reset(); |
782 #endif // defined(OS_CHROMEOS) | 783 #endif // defined(OS_CHROMEOS) |
783 | 784 |
784 #if defined(OS_CHROMEOS) | 785 #if defined(OS_CHROMEOS) |
785 PowerStatus::Shutdown(); | 786 PowerStatus::Shutdown(); |
786 #endif | 787 #endif |
787 | 788 |
788 DCHECK(instance_ == this); | 789 DCHECK(instance_ == this); |
789 instance_ = NULL; | 790 instance_ = NULL; |
790 } | 791 } |
791 | 792 |
792 void Shell::Init() { | 793 void Shell::Init() { |
793 delegate_->PreInit(); | 794 delegate_->PreInit(); |
794 if (keyboard::IsKeyboardUsabilityExperimentEnabled()) { | 795 if (keyboard::IsKeyboardUsabilityExperimentEnabled()) { |
795 display_manager_->SetSecondDisplayMode(DisplayManager::VIRTUAL_KEYBOARD); | 796 display_manager_->SetSecondDisplayMode(DisplayManager::VIRTUAL_KEYBOARD); |
796 } | 797 } |
797 bool display_initialized = display_manager_->InitFromCommandLine(); | 798 bool display_initialized = display_manager_->InitFromCommandLine(); |
798 #if defined(OS_CHROMEOS) | 799 #if defined(OS_CHROMEOS) |
799 display_configurator_->Init(!gpu_support_->IsPanelFittingDisabled()); | 800 display_configurator_->Init(!gpu_support_->IsPanelFittingDisabled()); |
800 output_configurator_animation_.reset(new OutputConfiguratorAnimation()); | 801 display_configurator_animation_.reset(new DisplayConfiguratorAnimation()); |
801 display_configurator_->AddObserver(output_configurator_animation_.get()); | 802 display_configurator_->AddObserver(display_configurator_animation_.get()); |
802 | 803 |
803 projecting_observer_.reset(new ProjectingObserver()); | 804 projecting_observer_.reset(new ProjectingObserver()); |
804 display_configurator_->AddObserver(projecting_observer_.get()); | 805 display_configurator_->AddObserver(projecting_observer_.get()); |
805 | 806 |
806 if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) { | 807 if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) { |
807 display_change_observer_.reset(new DisplayChangeObserver); | 808 display_change_observer_.reset(new DisplayChangeObserver); |
808 // Register |display_change_observer_| first so that the rest of | 809 // Register |display_change_observer_| first so that the rest of |
809 // observer gets invoked after the root windows are configured. | 810 // observer gets invoked after the root windows are configured. |
810 display_configurator_->AddObserver(display_change_observer_.get()); | 811 display_configurator_->AddObserver(display_change_observer_.get()); |
811 display_error_observer_.reset(new DisplayErrorObserver()); | 812 display_error_observer_.reset(new DisplayErrorObserver()); |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 //////////////////////////////////////////////////////////////////////////////// | 1116 //////////////////////////////////////////////////////////////////////////////// |
1116 // Shell, aura::client::ActivationChangeObserver implementation: | 1117 // Shell, aura::client::ActivationChangeObserver implementation: |
1117 | 1118 |
1118 void Shell::OnWindowActivated(aura::Window* gained_active, | 1119 void Shell::OnWindowActivated(aura::Window* gained_active, |
1119 aura::Window* lost_active) { | 1120 aura::Window* lost_active) { |
1120 if (gained_active) | 1121 if (gained_active) |
1121 target_root_window_ = gained_active->GetRootWindow(); | 1122 target_root_window_ = gained_active->GetRootWindow(); |
1122 } | 1123 } |
1123 | 1124 |
1124 } // namespace ash | 1125 } // namespace ash |
OLD | NEW |