OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/shell.h" | 5 #include "ash/shell.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/accelerators/accelerator_controller.h" | 10 #include "ash/accelerators/accelerator_controller.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 GetRootWindowController(root) | 291 GetRootWindowController(root) |
292 ->ShowContextMenu(location_in_screen, source_type); | 292 ->ShowContextMenu(location_in_screen, source_type); |
293 } | 293 } |
294 | 294 |
295 void Shell::ShowAppList(aura::Window* window) { | 295 void Shell::ShowAppList(aura::Window* window) { |
296 // If the context window is not given, show it on the target root window. | 296 // If the context window is not given, show it on the target root window. |
297 if (!window) | 297 if (!window) |
298 window = GetTargetRootWindow(); | 298 window = GetTargetRootWindow(); |
299 if (!app_list_controller_) | 299 if (!app_list_controller_) |
300 app_list_controller_.reset(new AppListController); | 300 app_list_controller_.reset(new AppListController); |
301 app_list_controller_->SetVisible(true, window); | 301 app_list_controller_->Show(window); |
302 } | 302 } |
303 | 303 |
304 void Shell::DismissAppList() { | 304 void Shell::DismissAppList() { |
305 if (!app_list_controller_) | 305 if (!app_list_controller_) |
306 return; | 306 return; |
307 app_list_controller_->SetVisible(false, GetTargetRootWindow()); | 307 app_list_controller_->Dismiss(); |
308 } | 308 } |
309 | 309 |
310 void Shell::ToggleAppList(aura::Window* window) { | 310 void Shell::ToggleAppList(aura::Window* window) { |
311 if (app_list_controller_ && app_list_controller_->IsVisible()) { | 311 if (app_list_controller_ && app_list_controller_->IsVisible()) { |
312 DismissAppList(); | 312 DismissAppList(); |
313 return; | 313 return; |
314 } | 314 } |
315 | 315 |
316 ShowAppList(window); | 316 ShowAppList(window); |
317 } | 317 } |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 //////////////////////////////////////////////////////////////////////////////// | 1151 //////////////////////////////////////////////////////////////////////////////// |
1152 // Shell, aura::client::ActivationChangeObserver implementation: | 1152 // Shell, aura::client::ActivationChangeObserver implementation: |
1153 | 1153 |
1154 void Shell::OnWindowActivated(aura::Window* gained_active, | 1154 void Shell::OnWindowActivated(aura::Window* gained_active, |
1155 aura::Window* lost_active) { | 1155 aura::Window* lost_active) { |
1156 if (gained_active) | 1156 if (gained_active) |
1157 target_root_window_ = gained_active->GetRootWindow(); | 1157 target_root_window_ = gained_active->GetRootWindow(); |
1158 } | 1158 } |
1159 | 1159 |
1160 } // namespace ash | 1160 } // namespace ash |
OLD | NEW |