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