| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/aura_shell/shell.h" | 5 #include "ui/aura_shell/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 9 #include "ui/aura/aura_switches.h" | 11 #include "ui/aura/aura_switches.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 12 #include "ui/aura/client/aura_constants.h" |
| 11 #include "ui/aura/client/drag_drop_client.h" | 13 #include "ui/aura/client/drag_drop_client.h" |
| 12 #include "ui/aura/root_window.h" | 14 #include "ui/aura/root_window.h" |
| 13 #include "ui/aura/layout_manager.h" | 15 #include "ui/aura/layout_manager.h" |
| 14 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 15 #include "ui/aura/window_types.h" | 17 #include "ui/aura/window_types.h" |
| 16 #include "ui/aura_shell/activation_controller.h" | 18 #include "ui/aura_shell/activation_controller.h" |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 if (workspace_controller_.get()) | 280 if (workspace_controller_.get()) |
| 279 workspace_controller_->ToggleOverview(); | 281 workspace_controller_->ToggleOverview(); |
| 280 } | 282 } |
| 281 | 283 |
| 282 void Shell::ToggleAppList() { | 284 void Shell::ToggleAppList() { |
| 283 if (!app_list_.get()) | 285 if (!app_list_.get()) |
| 284 app_list_.reset(new internal::AppList); | 286 app_list_.reset(new internal::AppList); |
| 285 app_list_->SetVisible(!app_list_->IsVisible()); | 287 app_list_->SetVisible(!app_list_->IsVisible()); |
| 286 } | 288 } |
| 287 | 289 |
| 290 // Returns true if the screen is locked. |
| 291 bool Shell::IsScreenLocked() const { |
| 292 const aura::Window* lock_screen_container = GetContainer( |
| 293 internal::kShellWindowId_LockScreenContainer); |
| 294 const aura::Window::Windows& lock_screen_windows = |
| 295 lock_screen_container->children(); |
| 296 aura::Window::Windows::const_iterator lock_screen_it = |
| 297 std::find_if(lock_screen_windows.begin(), lock_screen_windows.end(), |
| 298 std::mem_fun(&aura::Window::IsVisible)); |
| 299 if (lock_screen_it != lock_screen_windows.end()) |
| 300 return true; |
| 301 |
| 302 return false; |
| 303 } |
| 304 |
| 288 //////////////////////////////////////////////////////////////////////////////// | 305 //////////////////////////////////////////////////////////////////////////////// |
| 289 // Shell, private: | 306 // Shell, private: |
| 290 | 307 |
| 291 void Shell::EnableWorkspaceManager() { | 308 void Shell::EnableWorkspaceManager() { |
| 292 aura::Window* default_container = | 309 aura::Window* default_container = |
| 293 GetContainer(internal::kShellWindowId_DefaultContainer); | 310 GetContainer(internal::kShellWindowId_DefaultContainer); |
| 294 | 311 |
| 295 workspace_controller_.reset( | 312 workspace_controller_.reset( |
| 296 new internal::WorkspaceController(default_container)); | 313 new internal::WorkspaceController(default_container)); |
| 297 workspace_controller_->SetLauncherModel(launcher_->model()); | 314 workspace_controller_->SetLauncherModel(launcher_->model()); |
| 298 default_container->SetEventFilter( | 315 default_container->SetEventFilter( |
| 299 new internal::DefaultContainerEventFilter(default_container)); | 316 new internal::DefaultContainerEventFilter(default_container)); |
| 300 default_container->SetLayoutManager( | 317 default_container->SetLayoutManager( |
| 301 new internal::DefaultContainerLayoutManager( | 318 new internal::DefaultContainerLayoutManager( |
| 302 workspace_controller_->workspace_manager())); | 319 workspace_controller_->workspace_manager())); |
| 303 } | 320 } |
| 304 | 321 |
| 305 } // namespace aura_shell | 322 } // namespace aura_shell |
| OLD | NEW |