| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "ash/system/locale/locale_notification_controller.h" | 51 #include "ash/system/locale/locale_notification_controller.h" |
| 52 #include "ash/system/status_area_widget.h" | 52 #include "ash/system/status_area_widget.h" |
| 53 #include "ash/system/tray/system_tray_delegate.h" | 53 #include "ash/system/tray/system_tray_delegate.h" |
| 54 #include "ash/system/tray/system_tray_notifier.h" | 54 #include "ash/system/tray/system_tray_notifier.h" |
| 55 #include "ash/wm/app_list_controller.h" | 55 #include "ash/wm/app_list_controller.h" |
| 56 #include "ash/wm/ash_focus_rules.h" | 56 #include "ash/wm/ash_focus_rules.h" |
| 57 #include "ash/wm/ash_native_cursor_manager.h" | 57 #include "ash/wm/ash_native_cursor_manager.h" |
| 58 #include "ash/wm/coordinate_conversion.h" | 58 #include "ash/wm/coordinate_conversion.h" |
| 59 #include "ash/wm/custom_frame_view_ash.h" | 59 #include "ash/wm/custom_frame_view_ash.h" |
| 60 #include "ash/wm/event_client_impl.h" | 60 #include "ash/wm/event_client_impl.h" |
| 61 #include "ash/wm/event_rewriter_event_filter.h" |
| 61 #include "ash/wm/lock_state_controller.h" | 62 #include "ash/wm/lock_state_controller.h" |
| 62 #include "ash/wm/mru_window_tracker.h" | 63 #include "ash/wm/mru_window_tracker.h" |
| 63 #include "ash/wm/overlay_event_filter.h" | 64 #include "ash/wm/overlay_event_filter.h" |
| 64 #include "ash/wm/overview/window_selector_controller.h" | 65 #include "ash/wm/overview/window_selector_controller.h" |
| 65 #include "ash/wm/power_button_controller.h" | 66 #include "ash/wm/power_button_controller.h" |
| 66 #include "ash/wm/resize_shadow_controller.h" | 67 #include "ash/wm/resize_shadow_controller.h" |
| 67 #include "ash/wm/root_window_layout_manager.h" | 68 #include "ash/wm/root_window_layout_manager.h" |
| 68 #include "ash/wm/screen_dimmer.h" | 69 #include "ash/wm/screen_dimmer.h" |
| 69 #include "ash/wm/system_gesture_event_filter.h" | 70 #include "ash/wm/system_gesture_event_filter.h" |
| 70 #include "ash/wm/system_modal_container_event_filter.h" | 71 #include "ash/wm/system_modal_container_event_filter.h" |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_scroller_.get()); |
| 623 magnifier_key_scroller_.reset(); | 624 magnifier_key_scroller_.reset(); |
| 624 #endif | 625 #endif |
| 626 RemovePreTargetHandler(event_rewriter_filter_.get()); |
| 625 RemovePreTargetHandler(user_activity_detector_.get()); | 627 RemovePreTargetHandler(user_activity_detector_.get()); |
| 626 RemovePreTargetHandler(overlay_filter_.get()); | 628 RemovePreTargetHandler(overlay_filter_.get()); |
| 627 RemovePreTargetHandler(input_method_filter_.get()); | 629 RemovePreTargetHandler(input_method_filter_.get()); |
| 628 RemovePreTargetHandler(accelerator_filter_.get()); | 630 RemovePreTargetHandler(accelerator_filter_.get()); |
| 629 RemovePreTargetHandler(event_transformation_handler_.get()); | 631 RemovePreTargetHandler(event_transformation_handler_.get()); |
| 630 RemovePreTargetHandler(toplevel_window_event_handler_.get()); | 632 RemovePreTargetHandler(toplevel_window_event_handler_.get()); |
| 631 RemovePostTargetHandler(toplevel_window_event_handler_.get()); | 633 RemovePostTargetHandler(toplevel_window_event_handler_.get()); |
| 632 RemovePreTargetHandler(system_gesture_filter_.get()); | 634 RemovePreTargetHandler(system_gesture_filter_.get()); |
| 633 RemovePreTargetHandler(keyboard_metrics_filter_.get()); | 635 RemovePreTargetHandler(keyboard_metrics_filter_.get()); |
| 634 if (mouse_cursor_filter_) | 636 if (mouse_cursor_filter_) |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 | 827 |
| 826 nested_dispatcher_controller_.reset(new NestedDispatcherController); | 828 nested_dispatcher_controller_.reset(new NestedDispatcherController); |
| 827 accelerator_controller_.reset(new AcceleratorController); | 829 accelerator_controller_.reset(new AcceleratorController); |
| 828 | 830 |
| 829 #if defined(OS_CHROMEOS) && defined(USE_X11) | 831 #if defined(OS_CHROMEOS) && defined(USE_X11) |
| 830 magnifier_key_scroller_.reset(new MagnifierKeyScroller); | 832 magnifier_key_scroller_.reset(new MagnifierKeyScroller); |
| 831 AddPreTargetHandler(magnifier_key_scroller_.get()); | 833 AddPreTargetHandler(magnifier_key_scroller_.get()); |
| 832 #endif | 834 #endif |
| 833 | 835 |
| 834 // The order in which event filters are added is significant. | 836 // The order in which event filters are added is significant. |
| 837 event_rewriter_filter_.reset(new internal::EventRewriterEventFilter); |
| 838 AddPreTargetHandler(event_rewriter_filter_.get()); |
| 835 | 839 |
| 836 #if defined(OS_CHROMEOS) | 840 #if defined(OS_CHROMEOS) |
| 837 // The StickyKeysController also rewrites events and must be added | 841 // The StickyKeysController also rewrites events and must be added |
| 838 // before observers, but after the EventRewriterEventFilter. | 842 // before observers, but after the EventRewriterEventFilter. |
| 839 sticky_keys_controller_.reset(new StickyKeysController); | 843 sticky_keys_controller_.reset(new StickyKeysController); |
| 840 AddPreTargetHandler(sticky_keys_controller_.get()); | 844 AddPreTargetHandler(sticky_keys_controller_.get()); |
| 841 #endif | 845 #endif |
| 842 | 846 |
| 843 // UserActivityDetector passes events to observers, so let them get | 847 // UserActivityDetector passes events to observers, so let them get |
| 844 // rewritten first. | 848 // rewritten first. |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 //////////////////////////////////////////////////////////////////////////////// | 1076 //////////////////////////////////////////////////////////////////////////////// |
| 1073 // Shell, aura::client::ActivationChangeObserver implementation: | 1077 // Shell, aura::client::ActivationChangeObserver implementation: |
| 1074 | 1078 |
| 1075 void Shell::OnWindowActivated(aura::Window* gained_active, | 1079 void Shell::OnWindowActivated(aura::Window* gained_active, |
| 1076 aura::Window* lost_active) { | 1080 aura::Window* lost_active) { |
| 1077 if (gained_active) | 1081 if (gained_active) |
| 1078 target_root_window_ = gained_active->GetRootWindow(); | 1082 target_root_window_ = gained_active->GetRootWindow(); |
| 1079 } | 1083 } |
| 1080 | 1084 |
| 1081 } // namespace ash | 1085 } // namespace ash |
| OLD | NEW |