summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-13 03:15:40 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-13 03:15:40 +0000
commit1128681f3f257f6726b58ba35dba2c6e720115ac (patch)
tree3c274eef89a739d0911641761f20361043bb176d /ash
parent7bca40f56e2a04482e1ccb5d89f90c9335dd4329 (diff)
downloadchromium_src-1128681f3f257f6726b58ba35dba2c6e720115ac.zip
chromium_src-1128681f3f257f6726b58ba35dba2c6e720115ac.tar.gz
chromium_src-1128681f3f257f6726b58ba35dba2c6e720115ac.tar.bz2
* Don't activate a window if screen is locked.
* StopEventsPropagation should check window visibility. * Changed IsScreenLocked to use the same logic as CanFocus. BUG=none TEST=new test case is added to window_unittests.cc Review URL: http://codereview.chromium.org/9181012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117600 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/shell.cc10
-rw-r--r--ash/wm/activation_controller.cc8
2 files changed, 9 insertions, 9 deletions
diff --git a/ash/shell.cc b/ash/shell.cc
index 7d9863e..6627f8e 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -377,15 +377,7 @@ void Shell::ToggleAppList() {
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;
+ return lock_screen_container->StopsEventPropagation();
}
bool Shell::IsModalWindowOpen() const {
diff --git a/ash/wm/activation_controller.cc b/ash/wm/activation_controller.cc
index 5ea7466..7c56faf 100644
--- a/ash/wm/activation_controller.cc
+++ b/ash/wm/activation_controller.cc
@@ -119,6 +119,13 @@ void ActivationController::ActivateWindow(aura::Window* window) {
// activated or deactivated.
if (!CanActivateWindow(window))
return;
+ // If the screen is locked, just bring the window to top so that
+ // it will be activated when the lock window is destroyed.
+ if (window && !window->CanReceiveEvents()) {
+ StackTransientParentsBelowModalWindow(window);
+ window->parent()->StackChildAtTop(window);
+ return;
+ }
if (!window->Contains(window->GetFocusManager()->GetFocusedWindow()))
window->GetFocusManager()->SetFocusedWindow(window);
@@ -130,6 +137,7 @@ void ActivationController::ActivateWindow(aura::Window* window) {
// active.
if (old_active && aura::client::GetActivationDelegate(old_active))
aura::client::GetActivationDelegate(old_active)->OnLostActive();
+
if (window) {
StackTransientParentsBelowModalWindow(window);
window->parent()->StackChildAtTop(window);