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/focus_manager_factory.h" | 10 #include "ash/accelerators/focus_manager_factory.h" |
11 #include "ash/ash_switches.h" | 11 #include "ash/ash_switches.h" |
| 12 #include "ash/caps_lock_delegate_stub.h" |
12 #include "ash/desktop_background/desktop_background_controller.h" | 13 #include "ash/desktop_background/desktop_background_controller.h" |
13 #include "ash/desktop_background/desktop_background_resources.h" | 14 #include "ash/desktop_background/desktop_background_resources.h" |
14 #include "ash/desktop_background/desktop_background_view.h" | 15 #include "ash/desktop_background/desktop_background_view.h" |
| 16 #include "ash/display/display_controller.h" |
| 17 #include "ash/display/mouse_cursor_event_filter.h" |
| 18 #include "ash/display/multi_display_manager.h" |
| 19 #include "ash/display/screen_position_controller.h" |
| 20 #include "ash/display/secondary_display_view.h" |
15 #include "ash/drag_drop/drag_drop_controller.h" | 21 #include "ash/drag_drop/drag_drop_controller.h" |
16 #include "ash/focus_cycler.h" | 22 #include "ash/focus_cycler.h" |
17 #include "ash/high_contrast/high_contrast_controller.h" | 23 #include "ash/high_contrast/high_contrast_controller.h" |
18 #include "ash/launcher/launcher.h" | 24 #include "ash/launcher/launcher.h" |
19 #include "ash/magnifier/magnification_controller.h" | 25 #include "ash/magnifier/magnification_controller.h" |
20 #include "ash/display/display_controller.h" | |
21 #include "ash/display/mouse_cursor_event_filter.h" | |
22 #include "ash/display/multi_display_manager.h" | |
23 #include "ash/display/screen_position_controller.h" | |
24 #include "ash/display/secondary_display_view.h" | |
25 #include "ash/root_window_controller.h" | 26 #include "ash/root_window_controller.h" |
26 #include "ash/screen_ash.h" | 27 #include "ash/screen_ash.h" |
27 #include "ash/shell_context_menu.h" | 28 #include "ash/shell_context_menu.h" |
28 #include "ash/shell_delegate.h" | 29 #include "ash/shell_delegate.h" |
29 #include "ash/shell_factory.h" | 30 #include "ash/shell_factory.h" |
30 #include "ash/shell_window_ids.h" | 31 #include "ash/shell_window_ids.h" |
31 #include "ash/system/status_area_widget.h" | 32 #include "ash/system/status_area_widget.h" |
32 #include "ash/system/tray/system_tray.h" | 33 #include "ash/system/tray/system_tray.h" |
33 #include "ash/tooltips/tooltip_controller.h" | 34 #include "ash/tooltips/tooltip_controller.h" |
34 #include "ash/touch/touch_observer_hud.h" | 35 #include "ash/touch/touch_observer_hud.h" |
(...skipping 19 matching lines...) Expand all Loading... |
54 #include "ash/wm/stacking_controller.h" | 55 #include "ash/wm/stacking_controller.h" |
55 #include "ash/wm/status_area_layout_manager.h" | 56 #include "ash/wm/status_area_layout_manager.h" |
56 #include "ash/wm/system_gesture_event_filter.h" | 57 #include "ash/wm/system_gesture_event_filter.h" |
57 #include "ash/wm/system_modal_container_layout_manager.h" | 58 #include "ash/wm/system_modal_container_layout_manager.h" |
58 #include "ash/wm/toplevel_window_event_filter.h" | 59 #include "ash/wm/toplevel_window_event_filter.h" |
59 #include "ash/wm/user_activity_detector.h" | 60 #include "ash/wm/user_activity_detector.h" |
60 #include "ash/wm/video_detector.h" | 61 #include "ash/wm/video_detector.h" |
61 #include "ash/wm/visibility_controller.h" | 62 #include "ash/wm/visibility_controller.h" |
62 #include "ash/wm/window_cycle_controller.h" | 63 #include "ash/wm/window_cycle_controller.h" |
63 #include "ash/wm/window_modality_controller.h" | 64 #include "ash/wm/window_modality_controller.h" |
| 65 #include "ash/wm/window_properties.h" |
64 #include "ash/wm/window_util.h" | 66 #include "ash/wm/window_util.h" |
65 #include "ash/wm/window_properties.h" | |
66 #include "ash/wm/workspace/workspace_event_filter.h" | 67 #include "ash/wm/workspace/workspace_event_filter.h" |
67 #include "ash/wm/workspace/workspace_layout_manager.h" | 68 #include "ash/wm/workspace/workspace_layout_manager.h" |
68 #include "ash/wm/workspace_controller.h" | 69 #include "ash/wm/workspace_controller.h" |
69 #include "base/bind.h" | 70 #include "base/bind.h" |
70 #include "base/command_line.h" | 71 #include "base/command_line.h" |
71 #include "grit/ui_resources.h" | 72 #include "grit/ui_resources.h" |
72 #include "ui/aura/client/aura_constants.h" | 73 #include "ui/aura/client/aura_constants.h" |
73 #include "ui/aura/client/user_action_client.h" | 74 #include "ui/aura/client/user_action_client.h" |
| 75 #include "ui/aura/display_manager.h" |
74 #include "ui/aura/env.h" | 76 #include "ui/aura/env.h" |
75 #include "ui/aura/focus_manager.h" | 77 #include "ui/aura/focus_manager.h" |
76 #include "ui/aura/layout_manager.h" | 78 #include "ui/aura/layout_manager.h" |
77 #include "ui/aura/display_manager.h" | |
78 #include "ui/aura/root_window.h" | 79 #include "ui/aura/root_window.h" |
79 #include "ui/aura/shared/compound_event_filter.h" | 80 #include "ui/aura/shared/compound_event_filter.h" |
80 #include "ui/aura/shared/input_method_event_filter.h" | 81 #include "ui/aura/shared/input_method_event_filter.h" |
81 #include "ui/aura/ui_controls_aura.h" | 82 #include "ui/aura/ui_controls_aura.h" |
82 #include "ui/aura/window.h" | 83 #include "ui/aura/window.h" |
83 #include "ui/compositor/layer.h" | 84 #include "ui/compositor/layer.h" |
84 #include "ui/compositor/layer_animator.h" | 85 #include "ui/compositor/layer_animator.h" |
85 #include "ui/gfx/display.h" | 86 #include "ui/gfx/display.h" |
86 #include "ui/gfx/image/image_skia.h" | 87 #include "ui/gfx/image/image_skia.h" |
87 #include "ui/gfx/screen.h" | 88 #include "ui/gfx/screen.h" |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 video_detector_.reset(new VideoDetector); | 446 video_detector_.reset(new VideoDetector); |
446 window_cycle_controller_.reset( | 447 window_cycle_controller_.reset( |
447 new WindowCycleController(activation_controller_.get())); | 448 new WindowCycleController(activation_controller_.get())); |
448 | 449 |
449 tooltip_controller_.reset(new internal::TooltipController( | 450 tooltip_controller_.reset(new internal::TooltipController( |
450 drag_drop_controller_.get())); | 451 drag_drop_controller_.get())); |
451 AddEnvEventFilter(tooltip_controller_.get()); | 452 AddEnvEventFilter(tooltip_controller_.get()); |
452 | 453 |
453 InitRootWindowController(root_window_controller); | 454 InitRootWindowController(root_window_controller); |
454 | 455 |
| 456 // StatusAreaWidget uses Shell's CapsLockDelegate. |
| 457 if (delegate_.get()) |
| 458 caps_lock_delegate_.reset(delegate_->CreateCapsLockDelegate()); |
| 459 else |
| 460 caps_lock_delegate_.reset(new CapsLockDelegateStub); |
| 461 |
455 // Initialize Primary RootWindow specific items. | 462 // Initialize Primary RootWindow specific items. |
456 status_area_widget_ = new internal::StatusAreaWidget(); | 463 status_area_widget_ = new internal::StatusAreaWidget(); |
457 status_area_widget_->CreateTrayViews(delegate_.get()); | 464 status_area_widget_->CreateTrayViews(delegate_.get()); |
458 status_area_widget_->Show(); | 465 status_area_widget_->Show(); |
459 | 466 |
460 focus_cycler_.reset(new internal::FocusCycler()); | 467 focus_cycler_.reset(new internal::FocusCycler()); |
461 focus_cycler_->AddWidget(status_area_widget_); | 468 focus_cycler_->AddWidget(status_area_widget_); |
462 | 469 |
463 // This controller needs to be set before SetupManagedWindowMode. | 470 // This controller needs to be set before SetupManagedWindowMode. |
464 desktop_background_controller_.reset(new DesktopBackgroundController()); | 471 desktop_background_controller_.reset(new DesktopBackgroundController()); |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 } | 792 } |
786 | 793 |
787 void Shell::ShowCursor(bool visible) { | 794 void Shell::ShowCursor(bool visible) { |
788 RootWindowList root_windows = GetAllRootWindows(); | 795 RootWindowList root_windows = GetAllRootWindows(); |
789 for (RootWindowList::iterator iter = root_windows.begin(); | 796 for (RootWindowList::iterator iter = root_windows.begin(); |
790 iter != root_windows.end(); ++iter) | 797 iter != root_windows.end(); ++iter) |
791 (*iter)->ShowCursor(visible); | 798 (*iter)->ShowCursor(visible); |
792 } | 799 } |
793 | 800 |
794 } // namespace ash | 801 } // namespace ash |
OLD | NEW |