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

Unified Diff: ash/shell.cc

Issue 460933002: Split Shell::ToggleAppList() into ShowAppList and DismissAppList. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 6 years, 4 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
« ash/shell.h ('K') | « ash/shell.h ('k') | ash/shell/app_list.cc » ('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 2c393065aba614f7c7caa01fa365b5f490a2a9c8..a04774845bb229d014f3e8e4a9ee6233a55f0fc1 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -292,13 +292,28 @@ void Shell::ShowContextMenu(const gfx::Point& location_in_screen,
->ShowContextMenu(location_in_screen, source_type);
}
-void Shell::ToggleAppList(aura::Window* window) {
+void Shell::ShowAppList(aura::Window* window) {
// If the context window is not given, show it on the target root window.
if (!window)
window = GetTargetRootWindow();
if (!app_list_controller_)
app_list_controller_.reset(new AppListController);
- app_list_controller_->SetVisible(!app_list_controller_->IsVisible(), window);
+ app_list_controller_->SetVisible(true, window);
+}
+
+void Shell::DismissAppList() {
+ if (!app_list_controller_)
+ return;
+ app_list_controller_->SetVisible(false, GetTargetRootWindow());
+}
+
+void Shell::ToggleAppList(aura::Window* window) {
+ if (GetAppListTargetVisibility()) {
+ DismissAppList();
+ return;
+ }
+
+ ShowAppList(window);
}
bool Shell::GetAppListTargetVisibility() const {
« ash/shell.h ('K') | « ash/shell.h ('k') | ash/shell/app_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698