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 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "ash/display/screen_orientation_controller_chromeos.h" | 34 #include "ash/display/screen_orientation_controller_chromeos.h" |
35 #include "ash/display/screen_position_controller.h" | 35 #include "ash/display/screen_position_controller.h" |
36 #include "ash/display/shutdown_observer_chromeos.h" | 36 #include "ash/display/shutdown_observer_chromeos.h" |
37 #include "ash/display/window_tree_host_manager.h" | 37 #include "ash/display/window_tree_host_manager.h" |
38 #include "ash/drag_drop/drag_drop_controller.h" | 38 #include "ash/drag_drop/drag_drop_controller.h" |
39 #include "ash/first_run/first_run_helper_impl.h" | 39 #include "ash/first_run/first_run_helper_impl.h" |
40 #include "ash/focus_cycler.h" | 40 #include "ash/focus_cycler.h" |
41 #include "ash/frame/custom_frame_view_ash.h" | 41 #include "ash/frame/custom_frame_view_ash.h" |
42 #include "ash/gpu_support.h" | 42 #include "ash/gpu_support.h" |
43 #include "ash/high_contrast/high_contrast_controller.h" | 43 #include "ash/high_contrast/high_contrast_controller.h" |
44 #include "ash/ime/input_method_event_handler.h" | |
45 #include "ash/keyboard/keyboard_ui.h" | 44 #include "ash/keyboard/keyboard_ui.h" |
46 #include "ash/laser/laser_pointer_controller.h" | 45 #include "ash/laser/laser_pointer_controller.h" |
47 #include "ash/login_status.h" | 46 #include "ash/login_status.h" |
48 #include "ash/magnifier/magnification_controller.h" | 47 #include "ash/magnifier/magnification_controller.h" |
49 #include "ash/magnifier/partial_magnification_controller.h" | 48 #include "ash/magnifier/partial_magnification_controller.h" |
50 #include "ash/media_controller.h" | 49 #include "ash/media_controller.h" |
51 #include "ash/new_window_controller.h" | 50 #include "ash/new_window_controller.h" |
52 #include "ash/palette_delegate.h" | 51 #include "ash/palette_delegate.h" |
53 #include "ash/public/cpp/config.h" | 52 #include "ash/public/cpp/config.h" |
54 #include "ash/public/cpp/shell_window_ids.h" | 53 #include "ash/public/cpp/shell_window_ids.h" |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 shell_delegate_->PreShutdown(); | 613 shell_delegate_->PreShutdown(); |
615 | 614 |
616 // Remove the focus from any window. This will prevent overhead and side | 615 // Remove the focus from any window. This will prevent overhead and side |
617 // effects (e.g. crashes) from changing focus during shutdown. | 616 // effects (e.g. crashes) from changing focus during shutdown. |
618 // See bug crbug.com/134502. | 617 // See bug crbug.com/134502. |
619 aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(nullptr); | 618 aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(nullptr); |
620 | 619 |
621 // Please keep in same order as in Init() because it's easy to miss one. | 620 // Please keep in same order as in Init() because it's easy to miss one. |
622 if (window_modality_controller_) | 621 if (window_modality_controller_) |
623 window_modality_controller_.reset(); | 622 window_modality_controller_.reset(); |
624 if (config != Config::MASH) { | |
625 RemovePreTargetHandler( | |
626 window_tree_host_manager_->input_method_event_handler()); | |
627 } | |
628 | 623 |
629 RemovePreTargetHandler(magnifier_key_scroll_handler_.get()); | 624 RemovePreTargetHandler(magnifier_key_scroll_handler_.get()); |
630 magnifier_key_scroll_handler_.reset(); | 625 magnifier_key_scroll_handler_.reset(); |
631 | 626 |
632 RemovePreTargetHandler(speech_feedback_handler_.get()); | 627 RemovePreTargetHandler(speech_feedback_handler_.get()); |
633 speech_feedback_handler_.reset(); | 628 speech_feedback_handler_.reset(); |
634 | 629 |
635 RemovePreTargetHandler(overlay_filter_.get()); | 630 RemovePreTargetHandler(overlay_filter_.get()); |
636 overlay_filter_.reset(); | 631 overlay_filter_.reset(); |
637 | 632 |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 } | 942 } |
948 | 943 |
949 if (cursor_manager_) { | 944 if (cursor_manager_) { |
950 cursor_manager_->SetDisplay( | 945 cursor_manager_->SetDisplay( |
951 display::Screen::GetScreen()->GetPrimaryDisplay()); | 946 display::Screen::GetScreen()->GetPrimaryDisplay()); |
952 } | 947 } |
953 | 948 |
954 accelerator_controller_ = shell_port_->CreateAcceleratorController(); | 949 accelerator_controller_ = shell_port_->CreateAcceleratorController(); |
955 maximize_mode_controller_ = base::MakeUnique<MaximizeModeController>(); | 950 maximize_mode_controller_ = base::MakeUnique<MaximizeModeController>(); |
956 | 951 |
957 if (!ShouldUseIMEService()) { | |
958 // Not applicable when using IME service as events are already routed to | |
959 // InputMethod first. | |
960 AddPreTargetHandler( | |
961 window_tree_host_manager_->input_method_event_handler()); | |
962 } | |
963 | |
964 magnifier_key_scroll_handler_ = MagnifierKeyScroller::CreateHandler(); | 952 magnifier_key_scroll_handler_ = MagnifierKeyScroller::CreateHandler(); |
965 AddPreTargetHandler(magnifier_key_scroll_handler_.get()); | 953 AddPreTargetHandler(magnifier_key_scroll_handler_.get()); |
966 speech_feedback_handler_ = SpokenFeedbackToggler::CreateHandler(); | 954 speech_feedback_handler_ = SpokenFeedbackToggler::CreateHandler(); |
967 AddPreTargetHandler(speech_feedback_handler_.get()); | 955 AddPreTargetHandler(speech_feedback_handler_.get()); |
968 | 956 |
969 // The order in which event filters are added is significant. | 957 // The order in which event filters are added is significant. |
970 | 958 |
971 // ui::UserActivityDetector passes events to observers, so let them get | 959 // ui::UserActivityDetector passes events to observers, so let them get |
972 // rewritten first. | 960 // rewritten first. |
973 user_activity_detector_.reset(new ui::UserActivityDetector); | 961 user_activity_detector_.reset(new ui::UserActivityDetector); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 void Shell::OnPrefServiceInitialized( | 1251 void Shell::OnPrefServiceInitialized( |
1264 std::unique_ptr<::PrefService> pref_service) { | 1252 std::unique_ptr<::PrefService> pref_service) { |
1265 if (!instance_) | 1253 if (!instance_) |
1266 return; | 1254 return; |
1267 // |pref_service_| is null if can't connect to Chrome (as happens when | 1255 // |pref_service_| is null if can't connect to Chrome (as happens when |
1268 // running mash outside of chrome --mash and chrome isn't built). | 1256 // running mash outside of chrome --mash and chrome isn't built). |
1269 pref_service_ = std::move(pref_service); | 1257 pref_service_ = std::move(pref_service); |
1270 } | 1258 } |
1271 | 1259 |
1272 } // namespace ash | 1260 } // namespace ash |
OLD | NEW |