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 | 8 |
9 #include "ash/accelerators/accelerator_controller.h" | 9 #include "ash/accelerators/accelerator_controller.h" |
10 #include "ash/accelerators/accelerator_filter.h" | 10 #include "ash/accelerators/accelerator_filter.h" |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 370 |
371 void Shell::ToggleAppList() { | 371 void Shell::ToggleAppList() { |
372 if (!app_list_.get()) | 372 if (!app_list_.get()) |
373 app_list_.reset(new internal::AppList); | 373 app_list_.reset(new internal::AppList); |
374 app_list_->SetVisible(!app_list_->IsVisible()); | 374 app_list_->SetVisible(!app_list_->IsVisible()); |
375 } | 375 } |
376 | 376 |
377 bool Shell::IsScreenLocked() const { | 377 bool Shell::IsScreenLocked() const { |
378 const aura::Window* lock_screen_container = GetContainer( | 378 const aura::Window* lock_screen_container = GetContainer( |
379 internal::kShellWindowId_LockScreenContainer); | 379 internal::kShellWindowId_LockScreenContainer); |
380 const aura::Window::Windows& lock_screen_windows = | 380 return lock_screen_container->StopsEventPropagation(); |
381 lock_screen_container->children(); | |
382 aura::Window::Windows::const_iterator lock_screen_it = | |
383 std::find_if(lock_screen_windows.begin(), lock_screen_windows.end(), | |
384 std::mem_fun(&aura::Window::IsVisible)); | |
385 if (lock_screen_it != lock_screen_windows.end()) | |
386 return true; | |
387 | |
388 return false; | |
389 } | 381 } |
390 | 382 |
391 bool Shell::IsModalWindowOpen() const { | 383 bool Shell::IsModalWindowOpen() const { |
392 aura::Window* modal_container = | 384 aura::Window* modal_container = |
393 ash::Shell::GetInstance()->GetContainer( | 385 ash::Shell::GetInstance()->GetContainer( |
394 internal::kShellWindowId_AlwaysOnTopContainer); | 386 internal::kShellWindowId_AlwaysOnTopContainer); |
395 return !modal_container->children().empty(); | 387 return !modal_container->children().empty(); |
396 } | 388 } |
397 | 389 |
398 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( | 390 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( |
(...skipping 16 matching lines...) Expand all Loading... |
415 new internal::WorkspaceController(default_container)); | 407 new internal::WorkspaceController(default_container)); |
416 workspace_controller_->SetLauncherModel(launcher_->model()); | 408 workspace_controller_->SetLauncherModel(launcher_->model()); |
417 default_container->SetEventFilter( | 409 default_container->SetEventFilter( |
418 new internal::DefaultContainerEventFilter(default_container)); | 410 new internal::DefaultContainerEventFilter(default_container)); |
419 default_container->SetLayoutManager( | 411 default_container->SetLayoutManager( |
420 new internal::DefaultContainerLayoutManager( | 412 new internal::DefaultContainerLayoutManager( |
421 workspace_controller_->workspace_manager())); | 413 workspace_controller_->workspace_manager())); |
422 } | 414 } |
423 | 415 |
424 } // namespace ash | 416 } // namespace ash |
OLD | NEW |