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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "ash/shelf/shelf_widget.h" | 46 #include "ash/shelf/shelf_widget.h" |
47 #include "ash/shelf/shelf_window_watcher.h" | 47 #include "ash/shelf/shelf_window_watcher.h" |
48 #include "ash/shell_delegate.h" | 48 #include "ash/shell_delegate.h" |
49 #include "ash/shell_factory.h" | 49 #include "ash/shell_factory.h" |
50 #include "ash/shell_init_params.h" | 50 #include "ash/shell_init_params.h" |
51 #include "ash/shell_window_ids.h" | 51 #include "ash/shell_window_ids.h" |
52 #include "ash/system/locale/locale_notification_controller.h" | 52 #include "ash/system/locale/locale_notification_controller.h" |
53 #include "ash/system/status_area_widget.h" | 53 #include "ash/system/status_area_widget.h" |
54 #include "ash/system/tray/system_tray_delegate.h" | 54 #include "ash/system/tray/system_tray_delegate.h" |
55 #include "ash/system/tray/system_tray_notifier.h" | 55 #include "ash/system/tray/system_tray_notifier.h" |
56 #include "ash/virtual_keyboard_controller.h" | |
57 #include "ash/wm/app_list_controller.h" | 56 #include "ash/wm/app_list_controller.h" |
58 #include "ash/wm/ash_focus_rules.h" | 57 #include "ash/wm/ash_focus_rules.h" |
59 #include "ash/wm/ash_native_cursor_manager.h" | 58 #include "ash/wm/ash_native_cursor_manager.h" |
60 #include "ash/wm/coordinate_conversion.h" | 59 #include "ash/wm/coordinate_conversion.h" |
61 #include "ash/wm/event_client_impl.h" | 60 #include "ash/wm/event_client_impl.h" |
62 #include "ash/wm/lock_state_controller.h" | 61 #include "ash/wm/lock_state_controller.h" |
63 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 62 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
64 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" | 63 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" |
65 #include "ash/wm/mru_window_tracker.h" | 64 #include "ash/wm/mru_window_tracker.h" |
66 #include "ash/wm/overlay_event_filter.h" | 65 #include "ash/wm/overlay_event_filter.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 #include "ash/display/projecting_observer_chromeos.h" | 128 #include "ash/display/projecting_observer_chromeos.h" |
130 #include "ash/display/resolution_notification_controller.h" | 129 #include "ash/display/resolution_notification_controller.h" |
131 #include "ash/sticky_keys/sticky_keys_controller.h" | 130 #include "ash/sticky_keys/sticky_keys_controller.h" |
132 #include "ash/system/chromeos/bluetooth/bluetooth_notification_controller.h" | 131 #include "ash/system/chromeos/bluetooth/bluetooth_notification_controller.h" |
133 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h" | 132 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h" |
134 #include "ash/system/chromeos/power/power_event_observer.h" | 133 #include "ash/system/chromeos/power/power_event_observer.h" |
135 #include "ash/system/chromeos/power/power_status.h" | 134 #include "ash/system/chromeos/power/power_status.h" |
136 #include "ash/system/chromeos/power/video_activity_notifier.h" | 135 #include "ash/system/chromeos/power/video_activity_notifier.h" |
137 #include "ash/system/chromeos/session/last_window_closed_logout_reminder.h" | 136 #include "ash/system/chromeos/session/last_window_closed_logout_reminder.h" |
138 #include "ash/system/chromeos/session/logout_confirmation_controller.h" | 137 #include "ash/system/chromeos/session/logout_confirmation_controller.h" |
| 138 #include "ash/virtual_keyboard_controller.h" |
139 #include "base/bind_helpers.h" | 139 #include "base/bind_helpers.h" |
140 #include "base/sys_info.h" | 140 #include "base/sys_info.h" |
141 #include "chromeos/dbus/dbus_thread_manager.h" | 141 #include "chromeos/dbus/dbus_thread_manager.h" |
142 #include "ui/chromeos/user_activity_power_manager_notifier.h" | 142 #include "ui/chromeos/user_activity_power_manager_notifier.h" |
143 #include "ui/display/chromeos/display_configurator.h" | 143 #include "ui/display/chromeos/display_configurator.h" |
144 #endif // defined(OS_CHROMEOS) | 144 #endif // defined(OS_CHROMEOS) |
145 | 145 |
146 namespace ash { | 146 namespace ash { |
147 | 147 |
148 namespace { | 148 namespace { |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 #if defined(OS_CHROMEOS) && defined(USE_X11) | 787 #if defined(OS_CHROMEOS) && defined(USE_X11) |
788 touch_transformer_controller_.reset(); | 788 touch_transformer_controller_.reset(); |
789 #endif // defined(OS_CHROMEOS) && defined(USE_X11) | 789 #endif // defined(OS_CHROMEOS) && defined(USE_X11) |
790 | 790 |
791 // This also deletes all RootWindows. Note that we invoke Shutdown() on | 791 // This also deletes all RootWindows. Note that we invoke Shutdown() on |
792 // DisplayController before resetting |display_controller_|, since destruction | 792 // DisplayController before resetting |display_controller_|, since destruction |
793 // of its owned RootWindowControllers relies on the value. | 793 // of its owned RootWindowControllers relies on the value. |
794 display_manager_->CreateScreenForShutdown(); | 794 display_manager_->CreateScreenForShutdown(); |
795 display_controller_->Shutdown(); | 795 display_controller_->Shutdown(); |
796 display_controller_.reset(); | 796 display_controller_.reset(); |
| 797 #if defined(OS_CHROMEOS) |
797 virtual_keyboard_controller_.reset(); | 798 virtual_keyboard_controller_.reset(); |
| 799 #endif |
798 screen_position_controller_.reset(); | 800 screen_position_controller_.reset(); |
799 accessibility_delegate_.reset(); | 801 accessibility_delegate_.reset(); |
800 new_window_delegate_.reset(); | 802 new_window_delegate_.reset(); |
801 media_delegate_.reset(); | 803 media_delegate_.reset(); |
802 | 804 |
803 keyboard::KeyboardController::ResetInstance(NULL); | 805 keyboard::KeyboardController::ResetInstance(NULL); |
804 | 806 |
805 #if defined(OS_CHROMEOS) | 807 #if defined(OS_CHROMEOS) |
806 if (display_change_observer_) | 808 if (display_change_observer_) |
807 display_configurator_->RemoveObserver(display_change_observer_.get()); | 809 display_configurator_->RemoveObserver(display_change_observer_.get()); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 focus_client_.reset(focus_controller); | 881 focus_client_.reset(focus_controller); |
880 activation_client_ = focus_controller; | 882 activation_client_ = focus_controller; |
881 activation_client_->AddObserver(this); | 883 activation_client_->AddObserver(this); |
882 focus_cycler_.reset(new FocusCycler()); | 884 focus_cycler_.reset(new FocusCycler()); |
883 | 885 |
884 screen_position_controller_.reset(new ScreenPositionController); | 886 screen_position_controller_.reset(new ScreenPositionController); |
885 | 887 |
886 display_controller_->Start(); | 888 display_controller_->Start(); |
887 display_controller_->CreatePrimaryHost( | 889 display_controller_->CreatePrimaryHost( |
888 ShellInitParamsToAshWindowTreeHostInitParams(init_params)); | 890 ShellInitParamsToAshWindowTreeHostInitParams(init_params)); |
889 virtual_keyboard_controller_.reset(new VirtualKeyboardController); | |
890 aura::Window* root_window = display_controller_->GetPrimaryRootWindow(); | 891 aura::Window* root_window = display_controller_->GetPrimaryRootWindow(); |
891 target_root_window_ = root_window; | 892 target_root_window_ = root_window; |
892 | 893 |
893 #if defined(OS_CHROMEOS) | 894 #if defined(OS_CHROMEOS) |
894 resolution_notification_controller_.reset( | 895 resolution_notification_controller_.reset( |
895 new ResolutionNotificationController); | 896 new ResolutionNotificationController); |
896 #endif | 897 #endif |
897 | 898 |
898 cursor_manager_.SetDisplay(GetScreen()->GetPrimaryDisplay()); | 899 cursor_manager_.SetDisplay(GetScreen()->GetPrimaryDisplay()); |
899 | 900 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 | 1025 |
1025 #if defined(OS_CHROMEOS) && defined(USE_X11) | 1026 #if defined(OS_CHROMEOS) && defined(USE_X11) |
1026 // Create TouchTransformerController before DisplayController::InitDisplays() | 1027 // Create TouchTransformerController before DisplayController::InitDisplays() |
1027 // since TouchTransformerController listens on | 1028 // since TouchTransformerController listens on |
1028 // DisplayController::Observer::OnDisplaysInitialized(). | 1029 // DisplayController::Observer::OnDisplaysInitialized(). |
1029 touch_transformer_controller_.reset(new TouchTransformerController()); | 1030 touch_transformer_controller_.reset(new TouchTransformerController()); |
1030 #endif // defined(OS_CHROMEOS) && defined(USE_X11) | 1031 #endif // defined(OS_CHROMEOS) && defined(USE_X11) |
1031 | 1032 |
1032 display_controller_->InitDisplays(); | 1033 display_controller_->InitDisplays(); |
1033 | 1034 |
| 1035 #if defined(OS_CHROMEOS) |
| 1036 // Needs to be created after InitDisplays() since it may cause the virtual |
| 1037 // keyboard to be deployed. |
| 1038 virtual_keyboard_controller_.reset(new VirtualKeyboardController); |
| 1039 #endif // defined(OS_CHROMEOS) |
| 1040 |
1034 // It needs to be created after RootWindowController has been created | 1041 // It needs to be created after RootWindowController has been created |
1035 // (which calls OnWindowResized has been called, otherwise the | 1042 // (which calls OnWindowResized has been called, otherwise the |
1036 // widget will not paint when restoring after a browser crash. Also it needs | 1043 // widget will not paint when restoring after a browser crash. Also it needs |
1037 // to be created after InitSecondaryDisplays() to initialize the wallpapers in | 1044 // to be created after InitSecondaryDisplays() to initialize the wallpapers in |
1038 // the correct size. | 1045 // the correct size. |
1039 user_wallpaper_delegate_->InitializeWallpaper(); | 1046 user_wallpaper_delegate_->InitializeWallpaper(); |
1040 | 1047 |
1041 if (initially_hide_cursor_) | 1048 if (initially_hide_cursor_) |
1042 cursor_manager_.HideCursor(); | 1049 cursor_manager_.HideCursor(); |
1043 cursor_manager_.SetCursor(ui::kCursorPointer); | 1050 cursor_manager_.SetCursor(ui::kCursorPointer); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 //////////////////////////////////////////////////////////////////////////////// | 1165 //////////////////////////////////////////////////////////////////////////////// |
1159 // Shell, aura::client::ActivationChangeObserver implementation: | 1166 // Shell, aura::client::ActivationChangeObserver implementation: |
1160 | 1167 |
1161 void Shell::OnWindowActivated(aura::Window* gained_active, | 1168 void Shell::OnWindowActivated(aura::Window* gained_active, |
1162 aura::Window* lost_active) { | 1169 aura::Window* lost_active) { |
1163 if (gained_active) | 1170 if (gained_active) |
1164 target_root_window_ = gained_active->GetRootWindow(); | 1171 target_root_window_ = gained_active->GetRootWindow(); |
1165 } | 1172 } |
1166 | 1173 |
1167 } // namespace ash | 1174 } // namespace ash |
OLD | NEW |