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

Side by Side Diff: ash/shell.cc

Issue 1392713002: Extract content dependency from keyboard code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 2 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
« no previous file with comments | « ash/root_window_controller_unittest.cc ('k') | ash/shell/shell_delegate_impl.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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 #include "ui/aura/window_event_dispatcher.h" 89 #include "ui/aura/window_event_dispatcher.h"
90 #include "ui/base/ui_base_switches.h" 90 #include "ui/base/ui_base_switches.h"
91 #include "ui/base/user_activity/user_activity_detector.h" 91 #include "ui/base/user_activity/user_activity_detector.h"
92 #include "ui/compositor/layer.h" 92 #include "ui/compositor/layer.h"
93 #include "ui/compositor/layer_animator.h" 93 #include "ui/compositor/layer_animator.h"
94 #include "ui/events/event_target_iterator.h" 94 #include "ui/events/event_target_iterator.h"
95 #include "ui/gfx/display.h" 95 #include "ui/gfx/display.h"
96 #include "ui/gfx/geometry/size.h" 96 #include "ui/gfx/geometry/size.h"
97 #include "ui/gfx/image/image_skia.h" 97 #include "ui/gfx/image/image_skia.h"
98 #include "ui/gfx/screen.h" 98 #include "ui/gfx/screen.h"
99 #include "ui/keyboard/keyboard.h"
100 #include "ui/keyboard/keyboard_controller.h" 99 #include "ui/keyboard/keyboard_controller.h"
101 #include "ui/keyboard/keyboard_switches.h" 100 #include "ui/keyboard/keyboard_switches.h"
102 #include "ui/keyboard/keyboard_util.h" 101 #include "ui/keyboard/keyboard_util.h"
103 #include "ui/message_center/message_center.h" 102 #include "ui/message_center/message_center.h"
104 #include "ui/views/corewm/tooltip_aura.h" 103 #include "ui/views/corewm/tooltip_aura.h"
105 #include "ui/views/corewm/tooltip_controller.h" 104 #include "ui/views/corewm/tooltip_controller.h"
106 #include "ui/views/focus/focus_manager_factory.h" 105 #include "ui/views/focus/focus_manager_factory.h"
107 #include "ui/views/widget/native_widget_aura.h" 106 #include "ui/views/widget/native_widget_aura.h"
108 #include "ui/views/widget/widget.h" 107 #include "ui/views/widget/widget.h"
109 #include "ui/wm/core/accelerator_filter.h" 108 #include "ui/wm/core/accelerator_filter.h"
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 AddPreTargetHandler(event_transformation_handler_.get()); 951 AddPreTargetHandler(event_transformation_handler_.get());
953 952
954 toplevel_window_event_handler_.reset(new ToplevelWindowEventHandler); 953 toplevel_window_event_handler_.reset(new ToplevelWindowEventHandler);
955 954
956 system_gesture_filter_.reset(new SystemGestureEventFilter); 955 system_gesture_filter_.reset(new SystemGestureEventFilter);
957 AddPreTargetHandler(system_gesture_filter_.get()); 956 AddPreTargetHandler(system_gesture_filter_.get());
958 957
959 keyboard_metrics_filter_.reset(new KeyboardUMAEventFilter); 958 keyboard_metrics_filter_.reset(new KeyboardUMAEventFilter);
960 AddPreTargetHandler(keyboard_metrics_filter_.get()); 959 AddPreTargetHandler(keyboard_metrics_filter_.get());
961 960
962 // The keyboard system must be initialized before the RootWindowController is
963 // created.
964 #if defined(OS_CHROMEOS)
965 keyboard::InitializeKeyboard();
966 #endif
967
968 #if defined(OS_CHROMEOS) 961 #if defined(OS_CHROMEOS)
969 sticky_keys_controller_.reset(new StickyKeysController); 962 sticky_keys_controller_.reset(new StickyKeysController);
970 #endif 963 #endif
971 964
972 lock_state_controller_.reset(new LockStateController); 965 lock_state_controller_.reset(new LockStateController);
973 power_button_controller_.reset(new PowerButtonController( 966 power_button_controller_.reset(new PowerButtonController(
974 lock_state_controller_.get())); 967 lock_state_controller_.get()));
975 #if defined(OS_CHROMEOS) 968 #if defined(OS_CHROMEOS)
976 // Pass the initial display state to PowerButtonController. 969 // Pass the initial display state to PowerButtonController.
977 power_button_controller_->OnDisplayModeChanged( 970 power_button_controller_->OnDisplayModeChanged(
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 void Shell::InitKeyboard() { 1091 void Shell::InitKeyboard() {
1099 if (keyboard::IsKeyboardEnabled()) { 1092 if (keyboard::IsKeyboardEnabled()) {
1100 if (keyboard::KeyboardController::GetInstance()) { 1093 if (keyboard::KeyboardController::GetInstance()) {
1101 RootWindowControllerList controllers = GetAllRootWindowControllers(); 1094 RootWindowControllerList controllers = GetAllRootWindowControllers();
1102 for (RootWindowControllerList::iterator iter = controllers.begin(); 1095 for (RootWindowControllerList::iterator iter = controllers.begin();
1103 iter != controllers.end(); ++iter) { 1096 iter != controllers.end(); ++iter) {
1104 (*iter)->DeactivateKeyboard( 1097 (*iter)->DeactivateKeyboard(
1105 keyboard::KeyboardController::GetInstance()); 1098 keyboard::KeyboardController::GetInstance());
1106 } 1099 }
1107 } 1100 }
1108 keyboard::KeyboardControllerProxy* proxy =
1109 delegate_->CreateKeyboardControllerProxy();
1110 keyboard::KeyboardController::ResetInstance( 1101 keyboard::KeyboardController::ResetInstance(
1111 new keyboard::KeyboardController(proxy)); 1102 new keyboard::KeyboardController(delegate_->CreateKeyboardUI()));
1112 } 1103 }
1113 } 1104 }
1114 1105
1115 void Shell::InitRootWindow(aura::Window* root_window) { 1106 void Shell::InitRootWindow(aura::Window* root_window) {
1116 DCHECK(activation_client_); 1107 DCHECK(activation_client_);
1117 DCHECK(visibility_controller_.get()); 1108 DCHECK(visibility_controller_.get());
1118 DCHECK(drag_drop_controller_.get()); 1109 DCHECK(drag_drop_controller_.get());
1119 1110
1120 aura::client::SetFocusClient(root_window, focus_client_.get()); 1111 aura::client::SetFocusClient(root_window, focus_client_.get());
1121 aura::client::SetActivationClient(root_window, activation_client_); 1112 aura::client::SetActivationClient(root_window, activation_client_);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 1177
1187 void Shell::OnWindowActivated( 1178 void Shell::OnWindowActivated(
1188 aura::client::ActivationChangeObserver::ActivationReason reason, 1179 aura::client::ActivationChangeObserver::ActivationReason reason,
1189 aura::Window* gained_active, 1180 aura::Window* gained_active,
1190 aura::Window* lost_active) { 1181 aura::Window* lost_active) {
1191 if (gained_active) 1182 if (gained_active)
1192 target_root_window_ = gained_active->GetRootWindow(); 1183 target_root_window_ = gained_active->GetRootWindow();
1193 } 1184 }
1194 1185
1195 } // namespace ash 1186 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller_unittest.cc ('k') | ash/shell/shell_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698