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" |
15 #include "ash/drag_drop/drag_drop_controller.h" | 16 #include "ash/drag_drop/drag_drop_controller.h" |
16 #include "ash/focus_cycler.h" | 17 #include "ash/focus_cycler.h" |
Daniel Erat
2012/08/26 22:32:47
nit: not your fault, but mind alphabetizing these?
mazda
2012/08/27 16:06:40
Done.
| |
17 #include "ash/high_contrast/high_contrast_controller.h" | 18 #include "ash/high_contrast/high_contrast_controller.h" |
18 #include "ash/launcher/launcher.h" | 19 #include "ash/launcher/launcher.h" |
19 #include "ash/magnifier/magnification_controller.h" | 20 #include "ash/magnifier/magnification_controller.h" |
21 #include "ash/caps_lock_delegate.h" | |
20 #include "ash/display/display_controller.h" | 22 #include "ash/display/display_controller.h" |
21 #include "ash/display/mouse_cursor_event_filter.h" | 23 #include "ash/display/mouse_cursor_event_filter.h" |
22 #include "ash/display/multi_display_manager.h" | 24 #include "ash/display/multi_display_manager.h" |
23 #include "ash/display/screen_position_controller.h" | 25 #include "ash/display/screen_position_controller.h" |
24 #include "ash/display/secondary_display_view.h" | 26 #include "ash/display/secondary_display_view.h" |
25 #include "ash/root_window_controller.h" | 27 #include "ash/root_window_controller.h" |
26 #include "ash/screen_ash.h" | 28 #include "ash/screen_ash.h" |
27 #include "ash/shell_context_menu.h" | 29 #include "ash/shell_context_menu.h" |
28 #include "ash/shell_delegate.h" | 30 #include "ash/shell_delegate.h" |
29 #include "ash/shell_factory.h" | 31 #include "ash/shell_factory.h" |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
445 video_detector_.reset(new VideoDetector); | 447 video_detector_.reset(new VideoDetector); |
446 window_cycle_controller_.reset( | 448 window_cycle_controller_.reset( |
447 new WindowCycleController(activation_controller_.get())); | 449 new WindowCycleController(activation_controller_.get())); |
448 | 450 |
449 tooltip_controller_.reset(new internal::TooltipController( | 451 tooltip_controller_.reset(new internal::TooltipController( |
450 drag_drop_controller_.get())); | 452 drag_drop_controller_.get())); |
451 AddEnvEventFilter(tooltip_controller_.get()); | 453 AddEnvEventFilter(tooltip_controller_.get()); |
452 | 454 |
453 InitRootWindowController(root_window_controller); | 455 InitRootWindowController(root_window_controller); |
454 | 456 |
457 // StatusAreaWidget uses Shell's CapsLockDelegate. | |
458 if (delegate_.get()) | |
459 caps_lock_delegate_.reset(delegate_->CreateCapsLockDelegate()); | |
460 else | |
461 caps_lock_delegate_.reset(new CapsLockDelegateStub); | |
462 | |
455 // Initialize Primary RootWindow specific items. | 463 // Initialize Primary RootWindow specific items. |
456 status_area_widget_ = new internal::StatusAreaWidget(); | 464 status_area_widget_ = new internal::StatusAreaWidget(); |
457 status_area_widget_->CreateTrayViews(delegate_.get()); | 465 status_area_widget_->CreateTrayViews(delegate_.get()); |
458 status_area_widget_->Show(); | 466 status_area_widget_->Show(); |
459 | 467 |
460 focus_cycler_.reset(new internal::FocusCycler()); | 468 focus_cycler_.reset(new internal::FocusCycler()); |
461 focus_cycler_->AddWidget(status_area_widget_); | 469 focus_cycler_->AddWidget(status_area_widget_); |
462 | 470 |
463 // This controller needs to be set before SetupManagedWindowMode. | 471 // This controller needs to be set before SetupManagedWindowMode. |
464 desktop_background_controller_.reset(new DesktopBackgroundController()); | 472 desktop_background_controller_.reset(new DesktopBackgroundController()); |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
779 } | 787 } |
780 | 788 |
781 void Shell::ShowCursor(bool visible) { | 789 void Shell::ShowCursor(bool visible) { |
782 RootWindowList root_windows = GetAllRootWindows(); | 790 RootWindowList root_windows = GetAllRootWindows(); |
783 for (RootWindowList::iterator iter = root_windows.begin(); | 791 for (RootWindowList::iterator iter = root_windows.begin(); |
784 iter != root_windows.end(); ++iter) | 792 iter != root_windows.end(); ++iter) |
785 (*iter)->ShowCursor(visible); | 793 (*iter)->ShowCursor(visible); |
786 } | 794 } |
787 | 795 |
788 } // namespace ash | 796 } // namespace ash |
OLD | NEW |