| Index: ash/shell.cc
|
| diff --git a/ash/shell.cc b/ash/shell.cc
|
| index 5036193ddddfa135a165aff7dc5020427e5444f8..75c4f4a36c2b7c2fdcb1a31cf19d3047067c2dc5 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"
|
| @@ -351,12 +350,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));
|
| }
|
|
|
| @@ -373,12 +372,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.
|
| @@ -395,23 +394,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));
|
| }
|
|
|
| @@ -423,7 +422,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));
|
| }
|
|
|
| @@ -493,18 +492,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));
|
| }
|
|
|
| @@ -581,7 +580,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));
|
| }
|
|
|
| @@ -729,7 +728,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).
|
| @@ -797,7 +796,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();
|
|
|
| @@ -810,9 +809,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;
|
| }
|
| @@ -824,8 +820,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()));
|
| @@ -870,7 +865,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()) {
|
| @@ -954,7 +949,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),
|
| @@ -976,8 +971,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(
|
| @@ -987,7 +982,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
|
| @@ -1004,7 +999,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());
|
|
|
| @@ -1101,7 +1096,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();
|
|
|