Index: ash/shell.cc |
diff --git a/ash/shell.cc b/ash/shell.cc |
index 556682443b268bddf23b26699a1917d58bdaac79..1e8fa641c5f25df29c9a9d14fd20e39c720d3dc5 100644 |
--- a/ash/shell.cc |
+++ b/ash/shell.cc |
@@ -30,7 +30,6 @@ |
#include "ash/common/wm/root_window_finder.h" |
#include "ash/common/wm/window_positioner.h" |
#include "ash/common/wm_shell.h" |
-#include "ash/common/wm_shell_common.h" |
#include "ash/desktop_background/desktop_background_controller.h" |
#include "ash/desktop_background/desktop_background_view.h" |
#include "ash/desktop_background/user_wallpaper_delegate.h" |
@@ -350,12 +349,12 @@ void Shell::SetDisplayWorkAreaInsets(Window* contains, |
contains, insets)) { |
return; |
} |
- FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
+ FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), |
OnDisplayWorkAreaInsetsChanged()); |
} |
void Shell::OnLoginStateChanged(LoginStatus status) { |
- FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
+ FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), |
OnLoginStateChanged(status)); |
} |
@@ -372,12 +371,12 @@ void Shell::UpdateAfterLoginStatusChange(LoginStatus status) { |
} |
void Shell::OnAppTerminating() { |
- FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
+ FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), |
OnAppTerminating()); |
} |
void Shell::OnLockStateChanged(bool locked) { |
- FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
+ FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), |
OnLockStateChanged(locked)); |
#ifndef NDEBUG |
// Make sure that there is no system modal in Lock layer when unlocked. |
@@ -394,23 +393,23 @@ void Shell::OnLockStateChanged(bool locked) { |
void Shell::OnCastingSessionStartedOrStopped(bool started) { |
#if defined(OS_CHROMEOS) |
- FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
+ FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), |
OnCastingSessionStartedOrStopped(started)); |
#endif |
} |
void Shell::OnMaximizeModeStarted() { |
- FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
+ FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), |
OnMaximizeModeStarted()); |
} |
void Shell::OnMaximizeModeEnded() { |
- FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
+ FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), |
OnMaximizeModeEnded()); |
} |
void Shell::OnRootWindowAdded(WmWindow* root_window) { |
- FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
+ FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), |
OnRootWindowAdded(root_window)); |
} |
@@ -422,7 +421,7 @@ void Shell::CreateShelf() { |
} |
void Shell::OnShelfCreatedForRootWindow(WmWindow* root_window) { |
- FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
+ FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), |
OnShelfCreatedForRootWindow(root_window)); |
} |
@@ -492,18 +491,18 @@ void Shell::UpdateShelfVisibility() { |
} |
void Shell::OnShelfAlignmentChanged(WmWindow* root_window) { |
- FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
+ FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), |
OnShelfAlignmentChanged(root_window)); |
} |
void Shell::OnShelfAutoHideBehaviorChanged(WmWindow* root_window) { |
- FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
+ FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), |
OnShelfAutoHideBehaviorChanged(root_window)); |
} |
void Shell::NotifyFullscreenStateChange(bool is_fullscreen, |
WmWindow* root_window) { |
- FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
+ FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), |
OnFullscreenStateChanged(is_fullscreen, root_window)); |
} |
@@ -580,7 +579,7 @@ void Shell::SetTouchHudProjectionEnabled(bool enabled) { |
return; |
is_touch_hud_projection_enabled_ = enabled; |
- FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
+ FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), |
OnTouchHudProjectionToggled(enabled)); |
} |
@@ -728,7 +727,7 @@ Shell::~Shell() { |
// MruWindowTracker must be destroyed after all windows have been deleted to |
// avoid a possible crash when Shell is destroyed from a non-normal shutdown |
// path. (crbug.com/485438). |
- wm_shell_common_->DeleteMruWindowTracker(); |
+ wm_shell_->DeleteMruWindowTracker(); |
// Chrome implementation of shelf delegate depends on FocusClient, |
// so must be deleted before |focus_client_| (below). |
@@ -795,7 +794,7 @@ Shell::~Shell() { |
display_configurator_->RemoveObserver(display_error_observer_.get()); |
if (projecting_observer_) { |
display_configurator_->RemoveObserver(projecting_observer_.get()); |
- wm_shell_common_->RemoveShellObserver(projecting_observer_.get()); |
+ wm_shell_->RemoveShellObserver(projecting_observer_.get()); |
} |
display_change_observer_.reset(); |
@@ -808,9 +807,6 @@ Shell::~Shell() { |
// Needs to happen right before |instance_| is reset. |
wm_shell_.reset(); |
- // Must happen after |wm_shell_| is deleted. |
- wm_shell_common_.reset(); |
- |
DCHECK(instance_ == this); |
instance_ = nullptr; |
} |
@@ -822,8 +818,7 @@ void Shell::Init(const ShellInitParams& init_params) { |
DCHECK(in_mus_) << "linux desktop does not support ash."; |
#endif |
- wm_shell_common_.reset(new WmShellCommon); |
- wm_shell_.reset(new WmShellAura(wm_shell_common_.get())); |
+ wm_shell_.reset(new WmShellAura); |
scoped_overview_animation_settings_factory_.reset( |
new ScopedOverviewAnimationSettingsFactoryAura); |
window_positioner_.reset(new WindowPositioner(wm_shell_.get())); |
@@ -868,7 +863,7 @@ void Shell::Init(const ShellInitParams& init_params) { |
projecting_observer_.reset( |
new ProjectingObserver(dbus_thread_manager->GetPowerManagerClient())); |
display_configurator_->AddObserver(projecting_observer_.get()); |
- wm_shell_common_->AddShellObserver(projecting_observer_.get()); |
+ wm_shell_->AddShellObserver(projecting_observer_.get()); |
if (!in_mus_ && !display_initialized && |
base::SysInfo::IsRunningOnChromeOS()) { |
@@ -952,7 +947,7 @@ void Shell::Init(const ShellInitParams& init_params) { |
overlay_filter_.reset(new OverlayEventFilter); |
AddPreTargetHandler(overlay_filter_.get()); |
- wm_shell_common_->AddShellObserver(overlay_filter_.get()); |
+ wm_shell_->AddShellObserver(overlay_filter_.get()); |
accelerator_filter_.reset(new ::wm::AcceleratorFilter( |
std::unique_ptr<::wm::AcceleratorDelegate>(new AcceleratorDelegate), |
@@ -974,8 +969,8 @@ void Shell::Init(const ShellInitParams& init_params) { |
#if defined(OS_CHROMEOS) |
sticky_keys_controller_.reset(new StickyKeysController); |
#endif |
- screen_pinning_controller_.reset(new ScreenPinningController( |
- wm_shell_common_.get(), window_tree_host_manager_.get())); |
+ screen_pinning_controller_.reset( |
+ new ScreenPinningController(window_tree_host_manager_.get())); |
lock_state_controller_.reset(new LockStateController); |
power_button_controller_.reset( |
@@ -985,7 +980,7 @@ void Shell::Init(const ShellInitParams& init_params) { |
power_button_controller_->OnDisplayModeChanged( |
display_configurator_->cached_displays()); |
#endif |
- wm_shell_common_->AddShellObserver(lock_state_controller_.get()); |
+ wm_shell_->AddShellObserver(lock_state_controller_.get()); |
drag_drop_controller_.reset(new DragDropController); |
// |screenshot_controller_| needs to be created (and prepended as a |
@@ -1002,7 +997,7 @@ void Shell::Init(const ShellInitParams& init_params) { |
visibility_controller_.reset(new AshVisibilityController); |
magnification_controller_.reset(MagnificationController::CreateInstance()); |
- wm_shell_common_->CreateMruWindowTracker(); |
+ wm_shell_->CreateMruWindowTracker(); |
partial_magnification_controller_.reset(new PartialMagnificationController()); |
@@ -1098,7 +1093,7 @@ void Shell::Init(const ShellInitParams& init_params) { |
// is started. |
display_manager_->CreateMirrorWindowAsyncIfAny(); |
- FOR_EACH_OBSERVER(ShellObserver, *wm_shell_common_->shell_observers(), |
+ FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), |
OnShellInitialized()); |
user_metrics_recorder_->OnShellInitialized(); |