Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: ash/common/wm_shell.cc

Issue 2171813004: mash: Fold ShelfItemDelegateManager into ShelfModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/wm_shell.cc
diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc
index f0cb0180e11ac02d99348366cea072d57d3c534a..af91999ec4ed3858853735295e70a25c34b84dd2 100644
--- a/ash/common/wm_shell.cc
+++ b/ash/common/wm_shell.cc
@@ -9,6 +9,7 @@
#include "ash/common/accessibility_delegate.h"
#include "ash/common/focus_cycler.h"
#include "ash/common/keyboard/keyboard_ui.h"
+#include "ash/common/shelf/app_list_shelf_item_delegate.h"
#include "ash/common/shelf/shelf_model.h"
#include "ash/common/shell_delegate.h"
#include "ash/common/shell_window_ids.h"
@@ -54,11 +55,17 @@ void WmShell::Initialize() {
accessibility_delegate_.reset(delegate_->CreateAccessibilityDelegate());
media_delegate_.reset(delegate_->CreateMediaDelegate());
toast_manager_.reset(new ToastManager);
+
+ // Create the app list item in the shelf data model.
+ AppListShelfItemDelegate::CreateAppListItemAndDelegate(shelf_model_.get());
}
void WmShell::Shutdown() {
// Accesses WmShell in its destructor.
accessibility_delegate_.reset();
+ // ShelfItemDelegate subclasses it owns have complex cleanup to run, so
msw 2016/07/21 21:30:53 Is this still needed? Don't stress too much lookin
James Cook 2016/07/22 01:20:08 My worries about ARC items are the same as in the
msw 2016/07/22 01:49:51 Do you mean ArcAppDeferredLauncherItemController a
+ // explicitly shutdown early.
+ shelf_model_->Shutdown();
}
void WmShell::OnMaximizeModeStarted() {
@@ -103,14 +110,14 @@ void WmShell::RemoveLockStateObserver(LockStateObserver* observer) {
WmShell::WmShell(std::unique_ptr<ShellDelegate> shell_delegate)
: delegate_(std::move(shell_delegate)),
focus_cycler_(new FocusCycler),
- shelf_model_(new ShelfModel),
+ shelf_model_(new ShelfModel), // Must create before ShelfDelegate.
system_tray_notifier_(new SystemTrayNotifier),
+ window_cycle_controller_(new WindowCycleController),
window_selector_controller_(new WindowSelectorController) {
#if defined(OS_CHROMEOS)
brightness_control_delegate_.reset(new system::BrightnessControllerChromeos);
keyboard_brightness_control_delegate_.reset(new KeyboardBrightnessController);
#endif
- window_cycle_controller_.reset(new WindowCycleController());
}
WmShell::~WmShell() {}

Powered by Google App Engine
This is Rietveld 408576698