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

Unified Diff: ash/shell.cc

Issue 13993027: ash: Update app list button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for #1 Created 7 years, 8 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
« no previous file with comments | « ash/shell.h ('k') | ash/wm/app_list_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index 9297b0e11837c480898cc96def94d34e96648f40..93cd61f0806611e2c3356b26932925973bce778a 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -259,11 +259,11 @@ Shell::~Shell() {
// TooltipController is deleted with the Shell so removing its references.
RemovePreTargetHandler(tooltip_controller_.get());
- // AppList needs to be released before shelf layout manager, which is
- // destroyed with launcher container in the loop below. However, app list
- // container is now on top of launcher container and released after it.
- // TODO(xiyuan): Move it back when app list container is no longer needed.
- app_list_controller_.reset();
+ // AppList needs to clean up it dependency on Shell and closes its opened
+ // UI (if any) before closing all RootWindows. However, the controller
+ // instance is still needed so that sub views (e.g. app menu button on
+ // the shelf) could properly clean up.
+ app_list_controller_->Shutdown();
// Destroy SystemTrayDelegate before destroying the status area(s).
system_tray_delegate_->Shutdown();
@@ -586,6 +586,10 @@ void Shell::Init() {
if (!system_tray_delegate_)
system_tray_delegate_.reset(SystemTrayDelegate::CreateDummyDelegate());
+ // Creates app_list_controller_ before the launcher because app list
+ // button observes it for UI visibility.
+ app_list_controller_.reset(new internal::AppListController(this));
+
// Creates StatusAreaWidget.
root_window_controller->InitForPrimaryDisplay();
@@ -636,21 +640,15 @@ void Shell::ShowContextMenu(const gfx::Point& location_in_screen) {
}
void Shell::ToggleAppList(aura::Window* window) {
- // If the context window is not given, show it on the active root window.
- if (!window)
- window = GetActiveRootWindow();
- if (!app_list_controller_)
- app_list_controller_.reset(new internal::AppListController);
- app_list_controller_->SetVisible(!app_list_controller_->IsVisible(), window);
+ app_list_controller_->Toggle(window);
}
bool Shell::GetAppListTargetVisibility() const {
- return app_list_controller_.get() &&
- app_list_controller_->GetTargetVisibility();
+ return app_list_controller_->GetTargetVisibility();
}
aura::Window* Shell::GetAppListWindow() {
- return app_list_controller_.get() ? app_list_controller_->GetWindow() : NULL;
+ return app_list_controller_->GetWindow();
}
bool Shell::IsSystemModalWindowOpen() const {
« no previous file with comments | « ash/shell.h ('k') | ash/wm/app_list_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698