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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "ash/system/tray/system_tray_notifier.h" | 48 #include "ash/system/tray/system_tray_notifier.h" |
49 #include "ash/wm/app_list_controller.h" | 49 #include "ash/wm/app_list_controller.h" |
50 #include "ash/wm/ash_focus_rules.h" | 50 #include "ash/wm/ash_focus_rules.h" |
51 #include "ash/wm/ash_native_cursor_manager.h" | 51 #include "ash/wm/ash_native_cursor_manager.h" |
52 #include "ash/wm/base_layout_manager.h" | 52 #include "ash/wm/base_layout_manager.h" |
53 #include "ash/wm/coordinate_conversion.h" | 53 #include "ash/wm/coordinate_conversion.h" |
54 #include "ash/wm/custom_frame_view_ash.h" | 54 #include "ash/wm/custom_frame_view_ash.h" |
55 #include "ash/wm/event_client_impl.h" | 55 #include "ash/wm/event_client_impl.h" |
56 #include "ash/wm/event_rewriter_event_filter.h" | 56 #include "ash/wm/event_rewriter_event_filter.h" |
57 #include "ash/wm/lock_state_controller.h" | 57 #include "ash/wm/lock_state_controller.h" |
58 #include "ash/wm/lock_state_controller_impl2.h" | |
59 #include "ash/wm/mru_window_tracker.h" | 58 #include "ash/wm/mru_window_tracker.h" |
60 #include "ash/wm/overlay_event_filter.h" | 59 #include "ash/wm/overlay_event_filter.h" |
61 #include "ash/wm/overview/window_selector_controller.h" | 60 #include "ash/wm/overview/window_selector_controller.h" |
62 #include "ash/wm/power_button_controller.h" | 61 #include "ash/wm/power_button_controller.h" |
63 #include "ash/wm/resize_shadow_controller.h" | 62 #include "ash/wm/resize_shadow_controller.h" |
64 #include "ash/wm/root_window_layout_manager.h" | 63 #include "ash/wm/root_window_layout_manager.h" |
65 #include "ash/wm/screen_dimmer.h" | 64 #include "ash/wm/screen_dimmer.h" |
66 #include "ash/wm/session_state_controller_impl.h" | |
67 #include "ash/wm/system_gesture_event_filter.h" | 65 #include "ash/wm/system_gesture_event_filter.h" |
68 #include "ash/wm/system_modal_container_event_filter.h" | 66 #include "ash/wm/system_modal_container_event_filter.h" |
69 #include "ash/wm/system_modal_container_layout_manager.h" | 67 #include "ash/wm/system_modal_container_layout_manager.h" |
70 #include "ash/wm/user_activity_detector.h" | 68 #include "ash/wm/user_activity_detector.h" |
71 #include "ash/wm/video_detector.h" | 69 #include "ash/wm/video_detector.h" |
72 #include "ash/wm/window_animations.h" | 70 #include "ash/wm/window_animations.h" |
73 #include "ash/wm/window_cycle_controller.h" | 71 #include "ash/wm/window_cycle_controller.h" |
74 #include "ash/wm/window_properties.h" | 72 #include "ash/wm/window_properties.h" |
75 #include "ash/wm/window_util.h" | 73 #include "ash/wm/window_util.h" |
76 #include "ash/wm/workspace_controller.h" | 74 #include "ash/wm/workspace_controller.h" |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 AddPreTargetHandler(system_gesture_filter_.get()); | 484 AddPreTargetHandler(system_gesture_filter_.get()); |
487 | 485 |
488 keyboard_metrics_filter_.reset(new internal::KeyboardUMAEventFilter); | 486 keyboard_metrics_filter_.reset(new internal::KeyboardUMAEventFilter); |
489 AddPreTargetHandler(keyboard_metrics_filter_.get()); | 487 AddPreTargetHandler(keyboard_metrics_filter_.get()); |
490 | 488 |
491 // The keyboard system must be initialized before the RootWindowController is | 489 // The keyboard system must be initialized before the RootWindowController is |
492 // created. | 490 // created. |
493 if (keyboard::IsKeyboardEnabled()) | 491 if (keyboard::IsKeyboardEnabled()) |
494 keyboard::InitializeKeyboard(); | 492 keyboard::InitializeKeyboard(); |
495 | 493 |
496 if (command_line->HasSwitch(ash::switches::kAshDisableNewLockAnimations)) | 494 lock_state_controller_.reset(new LockStateController); |
497 lock_state_controller_.reset(new SessionStateControllerImpl); | |
498 else | |
499 lock_state_controller_.reset(new LockStateControllerImpl2); | |
500 power_button_controller_.reset(new PowerButtonController( | 495 power_button_controller_.reset(new PowerButtonController( |
501 lock_state_controller_.get())); | 496 lock_state_controller_.get())); |
502 AddShellObserver(lock_state_controller_.get()); | 497 AddShellObserver(lock_state_controller_.get()); |
503 | 498 |
504 drag_drop_controller_.reset(new internal::DragDropController); | 499 drag_drop_controller_.reset(new internal::DragDropController); |
505 mouse_cursor_filter_.reset(new internal::MouseCursorEventFilter()); | 500 mouse_cursor_filter_.reset(new internal::MouseCursorEventFilter()); |
506 PrependPreTargetHandler(mouse_cursor_filter_.get()); | 501 PrependPreTargetHandler(mouse_cursor_filter_.get()); |
507 | 502 |
508 // Create Controllers that may need root window. | 503 // Create Controllers that may need root window. |
509 // TODO(oshima): Move as many controllers before creating | 504 // TODO(oshima): Move as many controllers before creating |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 //////////////////////////////////////////////////////////////////////////////// | 929 //////////////////////////////////////////////////////////////////////////////// |
935 // Shell, aura::client::ActivationChangeObserver implementation: | 930 // Shell, aura::client::ActivationChangeObserver implementation: |
936 | 931 |
937 void Shell::OnWindowActivated(aura::Window* gained_active, | 932 void Shell::OnWindowActivated(aura::Window* gained_active, |
938 aura::Window* lost_active) { | 933 aura::Window* lost_active) { |
939 if (gained_active) | 934 if (gained_active) |
940 target_root_window_ = gained_active->GetRootWindow(); | 935 target_root_window_ = gained_active->GetRootWindow(); |
941 } | 936 } |
942 | 937 |
943 } // namespace ash | 938 } // namespace ash |
OLD | NEW |