Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(640)

Side by Side Diff: ash/shell.cc

Issue 165463002: event-rewrite: Clean up how events are rewritten. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix-debug Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/shell.h ('k') | ash/wm/event_rewriter_event_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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"
62 #include "ash/wm/lock_state_controller.h" 61 #include "ash/wm/lock_state_controller.h"
63 #include "ash/wm/mru_window_tracker.h" 62 #include "ash/wm/mru_window_tracker.h"
64 #include "ash/wm/overlay_event_filter.h" 63 #include "ash/wm/overlay_event_filter.h"
65 #include "ash/wm/overview/window_selector_controller.h" 64 #include "ash/wm/overview/window_selector_controller.h"
66 #include "ash/wm/power_button_controller.h" 65 #include "ash/wm/power_button_controller.h"
67 #include "ash/wm/resize_shadow_controller.h" 66 #include "ash/wm/resize_shadow_controller.h"
68 #include "ash/wm/root_window_layout_manager.h" 67 #include "ash/wm/root_window_layout_manager.h"
69 #include "ash/wm/screen_dimmer.h" 68 #include "ash/wm/screen_dimmer.h"
70 #include "ash/wm/system_gesture_event_filter.h" 69 #include "ash/wm/system_gesture_event_filter.h"
71 #include "ash/wm/system_modal_container_event_filter.h" 70 #include "ash/wm/system_modal_container_event_filter.h"
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 // 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.
621 if (window_modality_controller_) 620 if (window_modality_controller_)
622 window_modality_controller_.reset(); 621 window_modality_controller_.reset();
623 #if defined(OS_CHROMEOS) && defined(USE_X11) 622 #if defined(OS_CHROMEOS) && defined(USE_X11)
624 RemovePreTargetHandler(magnifier_key_scroll_handler_.get()); 623 RemovePreTargetHandler(magnifier_key_scroll_handler_.get());
625 magnifier_key_scroll_handler_.reset(); 624 magnifier_key_scroll_handler_.reset();
626 625
627 RemovePreTargetHandler(speech_feedback_handler_.get()); 626 RemovePreTargetHandler(speech_feedback_handler_.get());
628 speech_feedback_handler_.reset(); 627 speech_feedback_handler_.reset();
629 #endif 628 #endif
630 RemovePreTargetHandler(event_rewriter_filter_.get());
631 RemovePreTargetHandler(user_activity_detector_.get()); 629 RemovePreTargetHandler(user_activity_detector_.get());
632 RemovePreTargetHandler(overlay_filter_.get()); 630 RemovePreTargetHandler(overlay_filter_.get());
633 RemovePreTargetHandler(input_method_filter_.get()); 631 RemovePreTargetHandler(input_method_filter_.get());
634 RemovePreTargetHandler(accelerator_filter_.get()); 632 RemovePreTargetHandler(accelerator_filter_.get());
635 RemovePreTargetHandler(event_transformation_handler_.get()); 633 RemovePreTargetHandler(event_transformation_handler_.get());
636 RemovePreTargetHandler(toplevel_window_event_handler_.get()); 634 RemovePreTargetHandler(toplevel_window_event_handler_.get());
637 RemovePostTargetHandler(toplevel_window_event_handler_.get()); 635 RemovePostTargetHandler(toplevel_window_event_handler_.get());
638 RemovePreTargetHandler(system_gesture_filter_.get()); 636 RemovePreTargetHandler(system_gesture_filter_.get());
639 RemovePreTargetHandler(keyboard_metrics_filter_.get()); 637 RemovePreTargetHandler(keyboard_metrics_filter_.get());
640 if (mouse_cursor_filter_) 638 if (mouse_cursor_filter_)
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 accelerator_controller_.reset(new AcceleratorController); 831 accelerator_controller_.reset(new AcceleratorController);
834 832
835 #if defined(OS_CHROMEOS) && defined(USE_X11) 833 #if defined(OS_CHROMEOS) && defined(USE_X11)
836 magnifier_key_scroll_handler_ = MagnifierKeyScroller::CreateHandler().Pass(); 834 magnifier_key_scroll_handler_ = MagnifierKeyScroller::CreateHandler().Pass();
837 AddPreTargetHandler(magnifier_key_scroll_handler_.get()); 835 AddPreTargetHandler(magnifier_key_scroll_handler_.get());
838 speech_feedback_handler_ = SpokenFeedbackToggler::CreateHandler().Pass(); 836 speech_feedback_handler_ = SpokenFeedbackToggler::CreateHandler().Pass();
839 AddPreTargetHandler(speech_feedback_handler_.get()); 837 AddPreTargetHandler(speech_feedback_handler_.get());
840 #endif 838 #endif
841 839
842 // The order in which event filters are added is significant. 840 // The order in which event filters are added is significant.
843 event_rewriter_filter_.reset(new internal::EventRewriterEventFilter);
844 AddPreTargetHandler(event_rewriter_filter_.get());
845 841
846 #if defined(OS_CHROMEOS) 842 #if defined(OS_CHROMEOS)
847 // The StickyKeysController also rewrites events and must be added 843 // The StickyKeysController also rewrites events and must be added
848 // before observers, but after the EventRewriterEventFilter. 844 // before observers, but after the EventRewriterEventFilter.
849 sticky_keys_controller_.reset(new StickyKeysController); 845 sticky_keys_controller_.reset(new StickyKeysController);
850 AddPreTargetHandler(sticky_keys_controller_.get()); 846 AddPreTargetHandler(sticky_keys_controller_.get());
851 #endif 847 #endif
852 848
853 // UserActivityDetector passes events to observers, so let them get 849 // UserActivityDetector passes events to observers, so let them get
854 // rewritten first. 850 // rewritten first.
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 //////////////////////////////////////////////////////////////////////////////// 1078 ////////////////////////////////////////////////////////////////////////////////
1083 // Shell, aura::client::ActivationChangeObserver implementation: 1079 // Shell, aura::client::ActivationChangeObserver implementation:
1084 1080
1085 void Shell::OnWindowActivated(aura::Window* gained_active, 1081 void Shell::OnWindowActivated(aura::Window* gained_active,
1086 aura::Window* lost_active) { 1082 aura::Window* lost_active) {
1087 if (gained_active) 1083 if (gained_active)
1088 target_root_window_ = gained_active->GetRootWindow(); 1084 target_root_window_ = gained_active->GetRootWindow();
1089 } 1085 }
1090 1086
1091 } // namespace ash 1087 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | ash/wm/event_rewriter_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698