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

Unified Diff: ash/common/wm_shell.cc

Issue 2391253004: Use mojo Shelf interfaces for both mash and classic ash. (Closed)
Patch Set: Address manifest comment; working on test failures/crashes. Created 4 years, 2 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 7cbd81edd5368ddeef75804b8295bb639a1c31c3..dfa94c35973c858a708cac0fbb8da374b4e1a5b3 100644
--- a/ash/common/wm_shell.cc
+++ b/ash/common/wm_shell.cc
@@ -76,7 +76,7 @@ void WmShell::Initialize(const scoped_refptr<base::SequencedWorkerPool>& pool) {
toast_manager_.reset(new ToastManager);
// Create the app list item in the shelf data model.
- AppListShelfItemDelegate::CreateAppListItemAndDelegate(shelf_model_.get());
+ AppListShelfItemDelegate::CreateAppListItemAndDelegate(shelf_model());
// Install the custom factory early on so that views::FocusManagers for Tray,
// Shelf, and WallPaper could be created by the factory.
@@ -96,7 +96,7 @@ void WmShell::Shutdown() {
shelf_window_watcher_.reset();
// ShelfItemDelegate subclasses it owns have complex cleanup to run (e.g. ARC
// shelf items in Chrome) so explicitly shutdown early.
- shelf_model_->DestroyItemDelegates();
+ shelf_model()->DestroyItemDelegates();
// Must be destroyed before FocusClient.
shelf_delegate_.reset();
@@ -141,8 +141,8 @@ void WmShell::CreateShelfDelegate() {
// about multi-profile login state.
DCHECK(GetSessionStateDelegate());
DCHECK_GT(GetSessionStateDelegate()->NumberOfLoggedInUsers(), 0);
- shelf_delegate_.reset(delegate_->CreateShelfDelegate(shelf_model_.get()));
- shelf_window_watcher_.reset(new ShelfWindowWatcher(shelf_model_.get()));
+ shelf_delegate_.reset(delegate_->CreateShelfDelegate(shelf_model()));
+ shelf_window_watcher_.reset(new ShelfWindowWatcher(shelf_model()));
}
void WmShell::OnMaximizeModeStarted() {
@@ -224,15 +224,16 @@ void WmShell::SetPaletteDelegateForTesting(
WmShell::WmShell(std::unique_ptr<ShellDelegate> shell_delegate)
: delegate_(std::move(shell_delegate)),
- focus_cycler_(new FocusCycler),
+ focus_cycler_(base::MakeUnique<FocusCycler>()),
immersive_context_(base::MakeUnique<ImmersiveContextAsh>()),
- shelf_model_(new ShelfModel), // Must create before ShelfDelegate.
- system_tray_controller_(
- new SystemTrayController(delegate_->GetShellConnector())),
- system_tray_notifier_(new SystemTrayNotifier),
+ shelf_controller_(base::MakeUnique<ShelfController>()),
+ system_tray_controller_(base::MakeUnique<SystemTrayController>(
+ delegate_->GetShellConnector())),
+ system_tray_notifier_(base::MakeUnique<SystemTrayNotifier>()),
wallpaper_delegate_(delegate_->CreateWallpaperDelegate()),
- window_cycle_controller_(new WindowCycleController),
- window_selector_controller_(new WindowSelectorController) {
+ window_cycle_controller_(base::MakeUnique<WindowCycleController>()),
+ window_selector_controller_(
+ base::MakeUnique<WindowSelectorController>()) {
#if defined(OS_CHROMEOS)
brightness_control_delegate_.reset(new system::BrightnessControllerChromeos);
keyboard_brightness_control_delegate_.reset(new KeyboardBrightnessController);
« ash/common/wm_shell.h ('K') | « ash/common/wm_shell.h ('k') | ash/mus/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698