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

Side by Side Diff: ash/shell.cc

Issue 2752593008: Move AcceleratorController from WmShell to Shell (Closed)
Patch Set: cleanup Created 3 years, 9 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
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 #include <utility> 9 #include <utility>
10 10
11 #include "ash/accelerators/accelerator_controller_delegate_aura.h"
12 #include "ash/accelerators/accelerator_delegate.h" 11 #include "ash/accelerators/accelerator_delegate.h"
13 #include "ash/accelerators/magnifier_key_scroller.h" 12 #include "ash/accelerators/magnifier_key_scroller.h"
14 #include "ash/accelerators/spoken_feedback_toggler.h" 13 #include "ash/accelerators/spoken_feedback_toggler.h"
15 #include "ash/app_list/app_list_delegate_impl.h" 14 #include "ash/app_list/app_list_delegate_impl.h"
16 #include "ash/aura/wm_shell_aura.h" 15 #include "ash/aura/wm_shell_aura.h"
17 #include "ash/autoclick/autoclick_controller.h" 16 #include "ash/autoclick/autoclick_controller.h"
18 #include "ash/common/accelerators/accelerator_controller.h" 17 #include "ash/common/accelerators/accelerator_controller.h"
19 #include "ash/common/accelerators/ash_focus_manager_factory.h" 18 #include "ash/common/accelerators/ash_focus_manager_factory.h"
20 #include "ash/common/accessibility_delegate.h" 19 #include "ash/common/accessibility_delegate.h"
21 #include "ash/common/ash_constants.h" 20 #include "ash/common/ash_constants.h"
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 if (!is_mash) { 836 if (!is_mash) {
838 resolution_notification_controller_.reset( 837 resolution_notification_controller_.reset(
839 new ResolutionNotificationController); 838 new ResolutionNotificationController);
840 } 839 }
841 840
842 if (cursor_manager_) { 841 if (cursor_manager_) {
843 cursor_manager_->SetDisplay( 842 cursor_manager_->SetDisplay(
844 display::Screen::GetScreen()->GetPrimaryDisplay()); 843 display::Screen::GetScreen()->GetPrimaryDisplay());
845 } 844 }
846 845
847 if (!is_mash) { 846 accelerator_controller_ = wm_shell_->CreateAcceleratorController();
848 // TODO(sky): move this to WmShell. http://crbug.com/671246.
849 accelerator_controller_delegate_.reset(
850 new AcceleratorControllerDelegateAura);
851 wm_shell_->SetAcceleratorController(base::MakeUnique<AcceleratorController>(
852 accelerator_controller_delegate_.get(), nullptr));
853 }
854 wm_shell_->CreateMaximizeModeController(); 847 wm_shell_->CreateMaximizeModeController();
855 848
856 if (!is_mash) { 849 if (!is_mash) {
857 AddPreTargetHandler( 850 AddPreTargetHandler(
858 window_tree_host_manager_->input_method_event_handler()); 851 window_tree_host_manager_->input_method_event_handler());
859 } 852 }
860 853
861 magnifier_key_scroll_handler_ = MagnifierKeyScroller::CreateHandler(); 854 magnifier_key_scroll_handler_ = MagnifierKeyScroller::CreateHandler();
862 AddPreTargetHandler(magnifier_key_scroll_handler_.get()); 855 AddPreTargetHandler(magnifier_key_scroll_handler_.get());
863 speech_feedback_handler_ = SpokenFeedbackToggler::CreateHandler(); 856 speech_feedback_handler_ = SpokenFeedbackToggler::CreateHandler();
864 AddPreTargetHandler(speech_feedback_handler_.get()); 857 AddPreTargetHandler(speech_feedback_handler_.get());
865 858
866 // The order in which event filters are added is significant. 859 // The order in which event filters are added is significant.
867 860
868 // ui::UserActivityDetector passes events to observers, so let them get 861 // ui::UserActivityDetector passes events to observers, so let them get
869 // rewritten first. 862 // rewritten first.
870 user_activity_detector_.reset(new ui::UserActivityDetector); 863 user_activity_detector_.reset(new ui::UserActivityDetector);
871 864
872 overlay_filter_.reset(new OverlayEventFilter); 865 overlay_filter_.reset(new OverlayEventFilter);
873 AddPreTargetHandler(overlay_filter_.get()); 866 AddPreTargetHandler(overlay_filter_.get());
874 AddShellObserver(overlay_filter_.get()); 867 AddShellObserver(overlay_filter_.get());
875 868
876 accelerator_filter_.reset(new ::wm::AcceleratorFilter( 869 accelerator_filter_.reset(new ::wm::AcceleratorFilter(
877 std::unique_ptr<::wm::AcceleratorDelegate>(new AcceleratorDelegate), 870 std::unique_ptr<::wm::AcceleratorDelegate>(new AcceleratorDelegate),
878 wm_shell_->accelerator_controller()->accelerator_history())); 871 accelerator_controller_->accelerator_history()));
879 AddPreTargetHandler(accelerator_filter_.get()); 872 AddPreTargetHandler(accelerator_filter_.get());
880 873
881 event_transformation_handler_.reset(new EventTransformationHandler); 874 event_transformation_handler_.reset(new EventTransformationHandler);
882 AddPreTargetHandler(event_transformation_handler_.get()); 875 AddPreTargetHandler(event_transformation_handler_.get());
883 876
884 toplevel_window_event_handler_.reset( 877 toplevel_window_event_handler_.reset(
885 new ToplevelWindowEventHandler(wm_shell_.get())); 878 new ToplevelWindowEventHandler(wm_shell_.get()));
886 879
887 if (!is_mash) { 880 if (!is_mash) {
888 system_gesture_filter_.reset(new SystemGestureEventFilter); 881 system_gesture_filter_.reset(new SystemGestureEventFilter);
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 void Shell::OnWindowActivated( 1096 void Shell::OnWindowActivated(
1104 aura::client::ActivationChangeObserver::ActivationReason reason, 1097 aura::client::ActivationChangeObserver::ActivationReason reason,
1105 aura::Window* gained_active, 1098 aura::Window* gained_active,
1106 aura::Window* lost_active) { 1099 aura::Window* lost_active) {
1107 WmWindow* gained_active_wm = WmWindow::Get(gained_active); 1100 WmWindow* gained_active_wm = WmWindow::Get(gained_active);
1108 if (gained_active_wm) 1101 if (gained_active_wm)
1109 root_window_for_new_windows_ = gained_active_wm->GetRootWindow(); 1102 root_window_for_new_windows_ = gained_active_wm->GetRootWindow();
1110 } 1103 }
1111 1104
1112 } // namespace ash 1105 } // namespace ash
OLDNEW
« ash/common/wm_shell.h ('K') | « ash/shell.h ('k') | ash/test/ash_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698