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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
285 // No context menus when screen is locked. | 285 // No context menus when screen is locked. |
286 if (session_state_delegate_->IsScreenLocked()) | 286 if (session_state_delegate_->IsScreenLocked()) |
287 return; | 287 return; |
288 | 288 |
289 aura::Window* root = | 289 aura::Window* root = |
290 wm::GetRootWindowMatching(gfx::Rect(location_in_screen, gfx::Size())); | 290 wm::GetRootWindowMatching(gfx::Rect(location_in_screen, gfx::Size())); |
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::ToggleAppList(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(!app_list_controller_->IsVisible(), window); | 301 app_list_controller_->SetVisible(true, window); |
302 } | |
303 | |
304 void Shell::DismissAppList() { | |
305 if (!app_list_controller_) | |
306 return; | |
307 app_list_controller_->SetVisible(false, GetTargetRootWindow()); | |
Matt Giuca
2014/08/14 04:17:07
Are you sure this is equivalent? i.e., does AppLis
calamity
2014/08/14 05:00:59
I checked the method definition and it looks fine.
Matt Giuca
2014/08/14 05:05:36
Acknowledged.
| |
302 } | 308 } |
303 | 309 |
304 bool Shell::GetAppListTargetVisibility() const { | 310 bool Shell::GetAppListTargetVisibility() const { |
305 return app_list_controller_.get() && | 311 return app_list_controller_.get() && |
306 app_list_controller_->GetTargetVisibility(); | 312 app_list_controller_->GetTargetVisibility(); |
307 } | 313 } |
308 | 314 |
309 aura::Window* Shell::GetAppListWindow() { | 315 aura::Window* Shell::GetAppListWindow() { |
310 return app_list_controller_.get() ? app_list_controller_->GetWindow() : NULL; | 316 return app_list_controller_.get() ? app_list_controller_->GetWindow() : NULL; |
311 } | 317 } |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1136 //////////////////////////////////////////////////////////////////////////////// | 1142 //////////////////////////////////////////////////////////////////////////////// |
1137 // Shell, aura::client::ActivationChangeObserver implementation: | 1143 // Shell, aura::client::ActivationChangeObserver implementation: |
1138 | 1144 |
1139 void Shell::OnWindowActivated(aura::Window* gained_active, | 1145 void Shell::OnWindowActivated(aura::Window* gained_active, |
1140 aura::Window* lost_active) { | 1146 aura::Window* lost_active) { |
1141 if (gained_active) | 1147 if (gained_active) |
1142 target_root_window_ = gained_active->GetRootWindow(); | 1148 target_root_window_ = gained_active->GetRootWindow(); |
1143 } | 1149 } |
1144 | 1150 |
1145 } // namespace ash | 1151 } // namespace ash |
OLD | NEW |