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

Unified Diff: ui/aura_shell/shell.cc

Issue 8817018: Implement cycle window forward/backward by keyboard shortcuts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 'Move IsLocked to Shell' Created 9 years 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
« no previous file with comments | « ui/aura_shell/shell.h ('k') | ui/aura_shell/shell_accelerator_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/shell.cc
diff --git a/ui/aura_shell/shell.cc b/ui/aura_shell/shell.cc
index 406215edf0c8b29e878f604d4eda60f520fb529d..862d497981adff4661f46bedd7d1a419c6cc982e 100644
--- a/ui/aura_shell/shell.cc
+++ b/ui/aura_shell/shell.cc
@@ -4,6 +4,8 @@
#include "ui/aura_shell/shell.h"
+#include <algorithm>
+
#include "base/bind.h"
#include "base/command_line.h"
#include "ui/aura/aura_switches.h"
@@ -281,6 +283,31 @@ void Shell::ToggleAppList() {
app_list_->SetVisible(!app_list_->IsVisible());
}
+// Returns true if the screen is locked.
+bool Shell::IsScreenLocked() const {
+ const aura::Window* lock_screen_container = GetContainer(
+ internal::kShellWindowId_LockScreenContainer);
+ const aura::Window::Windows& lock_screen_windows =
+ lock_screen_container->children();
+ aura::Window::Windows::const_iterator lock_screen_it =
+ std::find_if(lock_screen_windows.begin(), lock_screen_windows.end(),
+ std::mem_fun(&aura::Window::IsVisible));
+ if (lock_screen_it != lock_screen_windows.end())
+ return true;
+
+ const aura::Window* lock_modal_container = GetContainer(
Ben Goodger (Google) 2011/12/11 21:54:05 I don't believe it's possible to return true from
mazda 2011/12/12 04:53:33 This returns true in the line 240 of shell_unittes
+ internal::kShellWindowId_LockModalContainer);
+ const aura::Window::Windows& lock_modal_windows =
+ lock_modal_container->children();
+ aura::Window::Windows::const_iterator lock_modal_it =
+ std::find_if(lock_modal_windows.begin(), lock_modal_windows.end(),
+ std::mem_fun(&aura::Window::IsVisible));
+ if (lock_modal_it != lock_modal_windows.end())
+ return true;
+
+ return false;
+}
+
////////////////////////////////////////////////////////////////////////////////
// Shell, private:
« no previous file with comments | « ui/aura_shell/shell.h ('k') | ui/aura_shell/shell_accelerator_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698