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> | 7 #include <utility> |
8 | 8 |
9 #include "ash/common/accessibility_delegate.h" | |
9 #include "ash/common/focus_cycler.h" | 10 #include "ash/common/focus_cycler.h" |
10 #include "ash/common/keyboard/keyboard_ui.h" | 11 #include "ash/common/keyboard/keyboard_ui.h" |
11 #include "ash/common/shell_delegate.h" | 12 #include "ash/common/shell_delegate.h" |
12 #include "ash/common/shell_window_ids.h" | 13 #include "ash/common/shell_window_ids.h" |
13 #include "ash/common/system/brightness_control_delegate.h" | 14 #include "ash/common/system/brightness_control_delegate.h" |
14 #include "ash/common/system/keyboard_brightness_control_delegate.h" | 15 #include "ash/common/system/keyboard_brightness_control_delegate.h" |
15 #include "ash/common/system/tray/system_tray_delegate.h" | 16 #include "ash/common/system/tray/system_tray_delegate.h" |
16 #include "ash/common/system/tray/system_tray_notifier.h" | 17 #include "ash/common/system/tray/system_tray_notifier.h" |
17 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 18 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
18 #include "ash/common/wm/mru_window_tracker.h" | 19 #include "ash/common/wm/mru_window_tracker.h" |
(...skipping 19 matching lines...) Expand all Loading... | |
38 } | 39 } |
39 | 40 |
40 // static | 41 // static |
41 WmShell* WmShell::Get() { | 42 WmShell* WmShell::Get() { |
42 return instance_; | 43 return instance_; |
43 } | 44 } |
44 | 45 |
45 void WmShell::Initialize() { | 46 void WmShell::Initialize() { |
46 // Some delegates access WmShell during their construction. Create them here | 47 // Some delegates access WmShell during their construction. Create them here |
47 // instead of the WmShell constructor. | 48 // instead of the WmShell constructor. |
49 accessibility_delegate_.reset(delegate_->CreateAccessibilityDelegate()); | |
48 media_delegate_.reset(delegate_->CreateMediaDelegate()); | 50 media_delegate_.reset(delegate_->CreateMediaDelegate()); |
49 } | 51 } |
50 | 52 |
53 void WmShell::Shutdown() { | |
54 media_delegate_.reset(); | |
James Cook
2016/07/14 23:31:46
Not strictly necessary, but a little clearer I thi
msw
2016/07/15 15:33:14
I'd be wary of adding explicit destruction if none
James Cook
2016/07/15 17:03:06
Done. Removed media_delegate_.reset(). Added a com
| |
55 accessibility_delegate_.reset(); | |
56 } | |
57 | |
51 void WmShell::OnMaximizeModeStarted() { | 58 void WmShell::OnMaximizeModeStarted() { |
52 FOR_EACH_OBSERVER(ShellObserver, shell_observers_, OnMaximizeModeStarted()); | 59 FOR_EACH_OBSERVER(ShellObserver, shell_observers_, OnMaximizeModeStarted()); |
53 } | 60 } |
54 | 61 |
55 void WmShell::OnMaximizeModeEnded() { | 62 void WmShell::OnMaximizeModeEnded() { |
56 FOR_EACH_OBSERVER(ShellObserver, shell_observers_, OnMaximizeModeEnded()); | 63 FOR_EACH_OBSERVER(ShellObserver, shell_observers_, OnMaximizeModeEnded()); |
57 } | 64 } |
58 | 65 |
59 void WmShell::NotifyPinnedStateChanged(WmWindow* pinned_window) { | 66 void WmShell::NotifyPinnedStateChanged(WmWindow* pinned_window) { |
60 FOR_EACH_OBSERVER(ShellObserver, shell_observers_, | 67 FOR_EACH_OBSERVER(ShellObserver, shell_observers_, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 | 154 |
148 void WmShell::CreateMruWindowTracker() { | 155 void WmShell::CreateMruWindowTracker() { |
149 mru_window_tracker_.reset(new MruWindowTracker); | 156 mru_window_tracker_.reset(new MruWindowTracker); |
150 } | 157 } |
151 | 158 |
152 void WmShell::DeleteMruWindowTracker() { | 159 void WmShell::DeleteMruWindowTracker() { |
153 mru_window_tracker_.reset(); | 160 mru_window_tracker_.reset(); |
154 } | 161 } |
155 | 162 |
156 } // namespace ash | 163 } // namespace ash |
OLD | NEW |