Index: ui/aura_shell/shell.cc |
diff --git a/ui/aura_shell/shell.cc b/ui/aura_shell/shell.cc |
index 87be5acada237f89b6bdc2ee5e3bdd495797c596..51c1b99d51f0f21cec974f84ebe52b84b877f4cf 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" |
@@ -285,6 +287,21 @@ 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; |
+ |
+ return false; |
+} |
+ |
//////////////////////////////////////////////////////////////////////////////// |
// Shell, private: |