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