OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/common/wm_shell.h" | 5 #include "ash/common/wm_shell.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "ash/common/focus_cycler.h" | 9 #include "ash/common/focus_cycler.h" |
8 #include "ash/common/keyboard/keyboard_ui.h" | 10 #include "ash/common/keyboard/keyboard_ui.h" |
9 #include "ash/common/shell_delegate.h" | 11 #include "ash/common/shell_delegate.h" |
10 #include "ash/common/shell_window_ids.h" | 12 #include "ash/common/shell_window_ids.h" |
11 #include "ash/common/system/brightness_control_delegate.h" | 13 #include "ash/common/system/brightness_control_delegate.h" |
12 #include "ash/common/system/keyboard_brightness_control_delegate.h" | 14 #include "ash/common/system/keyboard_brightness_control_delegate.h" |
13 #include "ash/common/system/tray/system_tray_delegate.h" | 15 #include "ash/common/system/tray/system_tray_delegate.h" |
14 #include "ash/common/system/tray/system_tray_notifier.h" | 16 #include "ash/common/system/tray/system_tray_notifier.h" |
15 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 17 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
16 #include "ash/common/wm/mru_window_tracker.h" | 18 #include "ash/common/wm/mru_window_tracker.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 61 } |
60 | 62 |
61 void WmShell::AddShellObserver(ShellObserver* observer) { | 63 void WmShell::AddShellObserver(ShellObserver* observer) { |
62 shell_observers_.AddObserver(observer); | 64 shell_observers_.AddObserver(observer); |
63 } | 65 } |
64 | 66 |
65 void WmShell::RemoveShellObserver(ShellObserver* observer) { | 67 void WmShell::RemoveShellObserver(ShellObserver* observer) { |
66 shell_observers_.RemoveObserver(observer); | 68 shell_observers_.RemoveObserver(observer); |
67 } | 69 } |
68 | 70 |
69 WmShell::WmShell(ShellDelegate* delegate) | 71 WmShell::WmShell(std::unique_ptr<ShellDelegate> shell_delegate) |
70 : delegate_(delegate), | 72 : delegate_(std::move(shell_delegate)), |
71 focus_cycler_(new FocusCycler), | 73 focus_cycler_(new FocusCycler), |
72 system_tray_notifier_(new SystemTrayNotifier), | 74 system_tray_notifier_(new SystemTrayNotifier), |
73 window_selector_controller_(new WindowSelectorController) { | 75 window_selector_controller_(new WindowSelectorController) { |
74 #if defined(OS_CHROMEOS) | 76 #if defined(OS_CHROMEOS) |
75 brightness_control_delegate_.reset(new system::BrightnessControllerChromeos); | 77 brightness_control_delegate_.reset(new system::BrightnessControllerChromeos); |
76 keyboard_brightness_control_delegate_.reset(new KeyboardBrightnessController); | 78 keyboard_brightness_control_delegate_.reset(new KeyboardBrightnessController); |
77 #endif | 79 #endif |
78 } | 80 } |
79 | 81 |
80 WmShell::~WmShell() {} | 82 WmShell::~WmShell() {} |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 145 |
144 void WmShell::CreateMruWindowTracker() { | 146 void WmShell::CreateMruWindowTracker() { |
145 mru_window_tracker_.reset(new MruWindowTracker); | 147 mru_window_tracker_.reset(new MruWindowTracker); |
146 } | 148 } |
147 | 149 |
148 void WmShell::DeleteMruWindowTracker() { | 150 void WmShell::DeleteMruWindowTracker() { |
149 mru_window_tracker_.reset(); | 151 mru_window_tracker_.reset(); |
150 } | 152 } |
151 | 153 |
152 } // namespace ash | 154 } // namespace ash |
OLD | NEW |