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

Unified Diff: ash/wm/activation_controller.cc

Issue 9181012: Don't activate a window if screen is locked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 months 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 | « ash/shell.cc ('k') | ui/aura/root_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/activation_controller.cc
diff --git a/ash/wm/activation_controller.cc b/ash/wm/activation_controller.cc
index 5ea7466c0f2a1a89222bf5f6b029fa1b0bbc7805..7c56faf6e423a24be71c97cb4e29bd294eef93cd 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);
« no previous file with comments | « ash/shell.cc ('k') | ui/aura/root_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698