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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 #include "ui/views/corewm/tooltip_aura.h" | 108 #include "ui/views/corewm/tooltip_aura.h" |
109 #include "ui/views/corewm/tooltip_controller.h" | 109 #include "ui/views/corewm/tooltip_controller.h" |
110 #include "ui/views/corewm/visibility_controller.h" | 110 #include "ui/views/corewm/visibility_controller.h" |
111 #include "ui/views/corewm/window_modality_controller.h" | 111 #include "ui/views/corewm/window_modality_controller.h" |
112 #include "ui/views/focus/focus_manager_factory.h" | 112 #include "ui/views/focus/focus_manager_factory.h" |
113 #include "ui/views/widget/native_widget_aura.h" | 113 #include "ui/views/widget/native_widget_aura.h" |
114 #include "ui/views/widget/widget.h" | 114 #include "ui/views/widget/widget.h" |
115 | 115 |
116 #if defined(OS_CHROMEOS) | 116 #if defined(OS_CHROMEOS) |
117 #if defined(USE_X11) | 117 #if defined(USE_X11) |
| 118 #include "ash/accelerators/magnifier_key_scroller.h" |
| 119 #include "ash/accelerators/spoken_feedback_toggler.h" |
118 #include "ash/ash_constants.h" | 120 #include "ash/ash_constants.h" |
119 #include "ash/display/display_change_observer_chromeos.h" | 121 #include "ash/display/display_change_observer_chromeos.h" |
120 #include "ash/display/display_error_observer_chromeos.h" | 122 #include "ash/display/display_error_observer_chromeos.h" |
121 #include "ash/display/output_configurator_animation.h" | 123 #include "ash/display/output_configurator_animation.h" |
122 #include "ash/display/projecting_observer_chromeos.h" | 124 #include "ash/display/projecting_observer_chromeos.h" |
123 #include "ash/magnifier/magnifier_key_scroller.h" | |
124 #include "base/message_loop/message_pump_x11.h" | 125 #include "base/message_loop/message_pump_x11.h" |
125 #include "base/sys_info.h" | 126 #include "base/sys_info.h" |
126 #include "chromeos/display/output_configurator.h" | 127 #include "chromeos/display/output_configurator.h" |
127 #endif // defined(USE_X11) | 128 #endif // defined(USE_X11) |
128 #include "ash/display/resolution_notification_controller.h" | 129 #include "ash/display/resolution_notification_controller.h" |
129 #include "ash/sticky_keys/sticky_keys_controller.h" | 130 #include "ash/sticky_keys/sticky_keys_controller.h" |
130 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h" | 131 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h" |
131 #include "ash/system/chromeos/power/power_event_observer.h" | 132 #include "ash/system/chromeos/power/power_event_observer.h" |
132 #include "ash/system/chromeos/power/power_status.h" | 133 #include "ash/system/chromeos/power/power_status.h" |
133 #include "ash/system/chromeos/power/user_activity_notifier.h" | 134 #include "ash/system/chromeos/power/user_activity_notifier.h" |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 | 613 |
613 // Remove the focus from any window. This will prevent overhead and side | 614 // Remove the focus from any window. This will prevent overhead and side |
614 // effects (e.g. crashes) from changing focus during shutdown. | 615 // effects (e.g. crashes) from changing focus during shutdown. |
615 // See bug crbug.com/134502. | 616 // See bug crbug.com/134502. |
616 aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(NULL); | 617 aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(NULL); |
617 | 618 |
618 // Please keep in same order as in Init() because it's easy to miss one. | 619 // Please keep in same order as in Init() because it's easy to miss one. |
619 if (window_modality_controller_) | 620 if (window_modality_controller_) |
620 window_modality_controller_.reset(); | 621 window_modality_controller_.reset(); |
621 #if defined(OS_CHROMEOS) && defined(USE_X11) | 622 #if defined(OS_CHROMEOS) && defined(USE_X11) |
622 RemovePreTargetHandler(magnifier_key_scroller_.get()); | 623 RemovePreTargetHandler(magnifier_key_scroll_handler_.get()); |
623 magnifier_key_scroller_.reset(); | 624 magnifier_key_scroll_handler_.reset(); |
| 625 |
| 626 RemovePreTargetHandler(speech_feedback_handler_.get()); |
| 627 speech_feedback_handler_.reset(); |
624 #endif | 628 #endif |
625 RemovePreTargetHandler(user_activity_detector_.get()); | 629 RemovePreTargetHandler(user_activity_detector_.get()); |
626 RemovePreTargetHandler(overlay_filter_.get()); | 630 RemovePreTargetHandler(overlay_filter_.get()); |
627 RemovePreTargetHandler(input_method_filter_.get()); | 631 RemovePreTargetHandler(input_method_filter_.get()); |
628 RemovePreTargetHandler(accelerator_filter_.get()); | 632 RemovePreTargetHandler(accelerator_filter_.get()); |
629 RemovePreTargetHandler(event_transformation_handler_.get()); | 633 RemovePreTargetHandler(event_transformation_handler_.get()); |
630 RemovePreTargetHandler(toplevel_window_event_handler_.get()); | 634 RemovePreTargetHandler(toplevel_window_event_handler_.get()); |
631 RemovePostTargetHandler(toplevel_window_event_handler_.get()); | 635 RemovePostTargetHandler(toplevel_window_event_handler_.get()); |
632 RemovePreTargetHandler(system_gesture_filter_.get()); | 636 RemovePreTargetHandler(system_gesture_filter_.get()); |
633 RemovePreTargetHandler(keyboard_metrics_filter_.get()); | 637 RemovePreTargetHandler(keyboard_metrics_filter_.get()); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 resolution_notification_controller_.reset( | 824 resolution_notification_controller_.reset( |
821 new internal::ResolutionNotificationController); | 825 new internal::ResolutionNotificationController); |
822 #endif | 826 #endif |
823 | 827 |
824 cursor_manager_.SetDisplay(GetScreen()->GetPrimaryDisplay()); | 828 cursor_manager_.SetDisplay(GetScreen()->GetPrimaryDisplay()); |
825 | 829 |
826 nested_dispatcher_controller_.reset(new NestedDispatcherController); | 830 nested_dispatcher_controller_.reset(new NestedDispatcherController); |
827 accelerator_controller_.reset(new AcceleratorController); | 831 accelerator_controller_.reset(new AcceleratorController); |
828 | 832 |
829 #if defined(OS_CHROMEOS) && defined(USE_X11) | 833 #if defined(OS_CHROMEOS) && defined(USE_X11) |
830 magnifier_key_scroller_.reset(new MagnifierKeyScroller); | 834 magnifier_key_scroll_handler_ = MagnifierKeyScroller::CreateHandler().Pass(); |
831 AddPreTargetHandler(magnifier_key_scroller_.get()); | 835 AddPreTargetHandler(magnifier_key_scroll_handler_.get()); |
| 836 speech_feedback_handler_ = SpokenFeedbackToggler::CreateHandler().Pass(); |
| 837 AddPreTargetHandler(speech_feedback_handler_.get()); |
832 #endif | 838 #endif |
833 | 839 |
834 // The order in which event filters are added is significant. | 840 // The order in which event filters are added is significant. |
835 | 841 |
836 #if defined(OS_CHROMEOS) | 842 #if defined(OS_CHROMEOS) |
837 // The StickyKeysController also rewrites events and must be added | 843 // The StickyKeysController also rewrites events and must be added |
838 // before observers, but after the EventRewriterEventFilter. | 844 // before observers, but after the EventRewriterEventFilter. |
839 sticky_keys_controller_.reset(new StickyKeysController); | 845 sticky_keys_controller_.reset(new StickyKeysController); |
840 AddPreTargetHandler(sticky_keys_controller_.get()); | 846 AddPreTargetHandler(sticky_keys_controller_.get()); |
841 #endif | 847 #endif |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 //////////////////////////////////////////////////////////////////////////////// | 1078 //////////////////////////////////////////////////////////////////////////////// |
1073 // Shell, aura::client::ActivationChangeObserver implementation: | 1079 // Shell, aura::client::ActivationChangeObserver implementation: |
1074 | 1080 |
1075 void Shell::OnWindowActivated(aura::Window* gained_active, | 1081 void Shell::OnWindowActivated(aura::Window* gained_active, |
1076 aura::Window* lost_active) { | 1082 aura::Window* lost_active) { |
1077 if (gained_active) | 1083 if (gained_active) |
1078 target_root_window_ = gained_active->GetRootWindow(); | 1084 target_root_window_ = gained_active->GetRootWindow(); |
1079 } | 1085 } |
1080 | 1086 |
1081 } // namespace ash | 1087 } // namespace ash |
OLD | NEW |