Index: ash/shell.cc |
diff --git a/ash/shell.cc b/ash/shell.cc |
index 751706c4682cfea6612abfa08dc95390ac6f8c18..b4972ec0a3a2024221a3e77d605e06c855dc8caa 100644 |
--- a/ash/shell.cc |
+++ b/ash/shell.cc |
@@ -57,6 +57,7 @@ |
#include "ash/system/tray/system_tray_delegate.h" |
#include "ash/system/tray/system_tray_notifier.h" |
#include "ash/utility/partial_screenshot_controller.h" |
+#include "ash/wm/app_list_controller.h" |
#include "ash/wm/ash_focus_rules.h" |
#include "ash/wm/ash_native_cursor_manager.h" |
#include "ash/wm/coordinate_conversion.h" |
@@ -84,7 +85,6 @@ |
#include "base/bind.h" |
#include "base/memory/ptr_util.h" |
#include "base/trace_event/trace_event.h" |
-#include "ui/app_list/shower/app_list_shower.h" |
#include "ui/aura/client/aura_constants.h" |
#include "ui/aura/env.h" |
#include "ui/aura/layout_manager.h" |
@@ -298,15 +298,19 @@ |
// If the context window is not given, show it on the target root window. |
if (!window) |
window = GetTargetRootWindow(); |
- delegate_->GetAppListShower()->Show(window); |
+ if (!app_list_controller_) |
+ app_list_controller_.reset(new AppListController); |
+ app_list_controller_->Show(window); |
} |
void Shell::DismissAppList() { |
- delegate_->GetAppListShower()->Dismiss(); |
+ if (!app_list_controller_) |
+ return; |
+ app_list_controller_->Dismiss(); |
} |
void Shell::ToggleAppList(aura::Window* window) { |
- if (delegate_->GetAppListShower()->IsVisible()) { |
+ if (app_list_controller_ && app_list_controller_->IsVisible()) { |
DismissAppList(); |
return; |
} |
@@ -315,7 +319,17 @@ |
} |
bool Shell::GetAppListTargetVisibility() const { |
- return delegate_->GetAppListShower()->GetTargetVisibility(); |
+ return app_list_controller_.get() && |
+ app_list_controller_->GetTargetVisibility(); |
+} |
+ |
+aura::Window* Shell::GetAppListWindow() { |
+ return app_list_controller_.get() ? app_list_controller_->GetWindow() |
+ : nullptr; |
+} |
+ |
+app_list::AppListView* Shell::GetAppListView() { |
+ return app_list_controller_.get() ? app_list_controller_->GetView() : nullptr; |
} |
bool Shell::IsSystemModalWindowOpen() const { |
@@ -704,6 +718,12 @@ |
// need to be removed. |
maximize_mode_controller_.reset(); |
+ // AppList needs to be released before shelf layout manager, which is |
+ // destroyed with shelf container in the loop below. However, app list |
+ // container is now on top of shelf container and released after it. |
+ // TODO(xiyuan): Move it back when app list container is no longer needed. |
+ app_list_controller_.reset(); |
+ |
#if defined(OS_CHROMEOS) |
// Destroy the LastWindowClosedLogoutReminder before the |
// LogoutConfirmationController. |