Index: ash/common/wm_shell.cc |
diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc |
index a1b8d99259d16ce0077b11309bc44b47b0ee7977..bb012d7abb237310a4c141fbfe0bbdaf163b45e2 100644 |
--- a/ash/common/wm_shell.cc |
+++ b/ash/common/wm_shell.cc |
@@ -42,6 +42,12 @@ WmShell* WmShell::Get() { |
return instance_; |
} |
+void WmShell::Initialize() { |
+ // Some delegates access WmShell during their construction. Create them here |
+ // instead of the WmShell constructor. |
+ media_delegate_.reset(delegate_->CreateMediaDelegate()); |
+} |
+ |
void WmShell::OnMaximizeModeStarted() { |
FOR_EACH_OBSERVER(ShellObserver, shell_observers_, OnMaximizeModeStarted()); |
} |
@@ -105,10 +111,6 @@ void WmShell::SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui) { |
keyboard_ui_ = std::move(keyboard_ui); |
} |
-void WmShell::SetMediaDelegate(std::unique_ptr<MediaDelegate> delegate) { |
- media_delegate_ = std::move(delegate); |
-} |
- |
void WmShell::SetSystemTrayDelegate( |
std::unique_ptr<SystemTrayDelegate> delegate) { |
DCHECK(delegate); |