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

Side by Side Diff: ash/shell.cc

Issue 164823005: Long press menu (shift+f6) to toggle spoken feedback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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"
11 #include "ash/accelerators/accelerator_filter.h" 11 #include "ash/accelerators/accelerator_filter.h"
12 #include "ash/accelerators/focus_manager_factory.h" 12 #include "ash/accelerators/focus_manager_factory.h"
13 #include "ash/accelerators/nested_dispatcher_controller.h" 13 #include "ash/accelerators/nested_dispatcher_controller.h"
14 #include "ash/accelerators/spoken_feedback_toggler.h"
14 #include "ash/ash_switches.h" 15 #include "ash/ash_switches.h"
15 #include "ash/autoclick/autoclick_controller.h" 16 #include "ash/autoclick/autoclick_controller.h"
16 #include "ash/caps_lock_delegate.h" 17 #include "ash/caps_lock_delegate.h"
17 #include "ash/desktop_background/desktop_background_controller.h" 18 #include "ash/desktop_background/desktop_background_controller.h"
18 #include "ash/desktop_background/desktop_background_view.h" 19 #include "ash/desktop_background/desktop_background_view.h"
19 #include "ash/desktop_background/user_wallpaper_delegate.h" 20 #include "ash/desktop_background/user_wallpaper_delegate.h"
20 #include "ash/display/cursor_window_controller.h" 21 #include "ash/display/cursor_window_controller.h"
21 #include "ash/display/display_controller.h" 22 #include "ash/display/display_controller.h"
22 #include "ash/display/display_manager.h" 23 #include "ash/display/display_manager.h"
23 #include "ash/display/event_transformation_handler.h" 24 #include "ash/display/event_transformation_handler.h"
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 614
614 // Remove the focus from any window. This will prevent overhead and side 615 // Remove the focus from any window. This will prevent overhead and side
615 // effects (e.g. crashes) from changing focus during shutdown. 616 // effects (e.g. crashes) from changing focus during shutdown.
616 // See bug crbug.com/134502. 617 // See bug crbug.com/134502.
617 aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(NULL); 618 aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(NULL);
618 619
619 // Please keep in same order as in Init() because it's easy to miss one. 620 // Please keep in same order as in Init() because it's easy to miss one.
620 if (window_modality_controller_) 621 if (window_modality_controller_)
621 window_modality_controller_.reset(); 622 window_modality_controller_.reset();
622 #if defined(OS_CHROMEOS) && defined(USE_X11) 623 #if defined(OS_CHROMEOS) && defined(USE_X11)
623 RemovePreTargetHandler(magnifier_key_scroller_.get()); 624 RemovePreTargetHandler(magnifier_key_scroll_handler_.get());
624 magnifier_key_scroller_.reset(); 625 magnifier_key_scroll_handler_.reset();
626
627 RemovePreTargetHandler(speech_feedback_handler_.get());
628 speech_feedback_handler_.reset();
625 #endif 629 #endif
626 RemovePreTargetHandler(event_rewriter_filter_.get()); 630 RemovePreTargetHandler(event_rewriter_filter_.get());
627 RemovePreTargetHandler(user_activity_detector_.get()); 631 RemovePreTargetHandler(user_activity_detector_.get());
628 RemovePreTargetHandler(overlay_filter_.get()); 632 RemovePreTargetHandler(overlay_filter_.get());
629 RemovePreTargetHandler(input_method_filter_.get()); 633 RemovePreTargetHandler(input_method_filter_.get());
630 RemovePreTargetHandler(accelerator_filter_.get()); 634 RemovePreTargetHandler(accelerator_filter_.get());
631 RemovePreTargetHandler(event_transformation_handler_.get()); 635 RemovePreTargetHandler(event_transformation_handler_.get());
632 RemovePreTargetHandler(toplevel_window_event_handler_.get()); 636 RemovePreTargetHandler(toplevel_window_event_handler_.get());
633 RemovePostTargetHandler(toplevel_window_event_handler_.get()); 637 RemovePostTargetHandler(toplevel_window_event_handler_.get());
634 RemovePreTargetHandler(system_gesture_filter_.get()); 638 RemovePreTargetHandler(system_gesture_filter_.get());
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 resolution_notification_controller_.reset( 826 resolution_notification_controller_.reset(
823 new internal::ResolutionNotificationController); 827 new internal::ResolutionNotificationController);
824 #endif 828 #endif
825 829
826 cursor_manager_.SetDisplay(GetScreen()->GetPrimaryDisplay()); 830 cursor_manager_.SetDisplay(GetScreen()->GetPrimaryDisplay());
827 831
828 nested_dispatcher_controller_.reset(new NestedDispatcherController); 832 nested_dispatcher_controller_.reset(new NestedDispatcherController);
829 accelerator_controller_.reset(new AcceleratorController); 833 accelerator_controller_.reset(new AcceleratorController);
830 834
831 #if defined(OS_CHROMEOS) && defined(USE_X11) 835 #if defined(OS_CHROMEOS) && defined(USE_X11)
832 magnifier_key_scroller_.reset(new MagnifierKeyScroller); 836 magnifier_key_scroll_handler_.reset(MagnifierKeyScroller::CreateHandler());
833 AddPreTargetHandler(magnifier_key_scroller_.get()); 837 AddPreTargetHandler(magnifier_key_scroll_handler_.get());
838 speech_feedback_handler_.reset(SpokenFeedbackToggler::CreateHandler());
839 AddPreTargetHandler(speech_feedback_handler_.get());
834 #endif 840 #endif
835 841
836 // The order in which event filters are added is significant. 842 // The order in which event filters are added is significant.
837 event_rewriter_filter_.reset(new internal::EventRewriterEventFilter); 843 event_rewriter_filter_.reset(new internal::EventRewriterEventFilter);
838 AddPreTargetHandler(event_rewriter_filter_.get()); 844 AddPreTargetHandler(event_rewriter_filter_.get());
839 845
840 #if defined(OS_CHROMEOS) 846 #if defined(OS_CHROMEOS)
841 // The StickyKeysController also rewrites events and must be added 847 // The StickyKeysController also rewrites events and must be added
842 // before observers, but after the EventRewriterEventFilter. 848 // before observers, but after the EventRewriterEventFilter.
843 sticky_keys_controller_.reset(new StickyKeysController); 849 sticky_keys_controller_.reset(new StickyKeysController);
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 //////////////////////////////////////////////////////////////////////////////// 1082 ////////////////////////////////////////////////////////////////////////////////
1077 // Shell, aura::client::ActivationChangeObserver implementation: 1083 // Shell, aura::client::ActivationChangeObserver implementation:
1078 1084
1079 void Shell::OnWindowActivated(aura::Window* gained_active, 1085 void Shell::OnWindowActivated(aura::Window* gained_active,
1080 aura::Window* lost_active) { 1086 aura::Window* lost_active) {
1081 if (gained_active) 1087 if (gained_active)
1082 target_root_window_ = gained_active->GetRootWindow(); 1088 target_root_window_ = gained_active->GetRootWindow();
1083 } 1089 }
1084 1090
1085 } // namespace ash 1091 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698