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

Side by Side 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: reduced the scope 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/wm/activation_controller.h" 5 #include "ash/wm/activation_controller.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/wm/window_modality_controller.h" 9 #include "ash/wm/window_modality_controller.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 22 matching lines...) Expand all
33 window->id() == kShellWindowId_ModalContainer || 33 window->id() == kShellWindowId_ModalContainer ||
34 window->id() == kShellWindowId_LockScreenContainer || 34 window->id() == kShellWindowId_LockScreenContainer ||
35 window->id() == kShellWindowId_LockModalContainer; 35 window->id() == kShellWindowId_LockModalContainer;
36 } 36 }
37 37
38 // Returns true if |window| can be activated or deactivated. 38 // Returns true if |window| can be activated or deactivated.
39 // A window manager typically defines some notion of "top level window" that 39 // A window manager typically defines some notion of "top level window" that
40 // supports activation/deactivation. 40 // supports activation/deactivation.
41 bool CanActivateWindow(aura::Window* window) { 41 bool CanActivateWindow(aura::Window* window) {
42 return window && 42 return window &&
43 window->IsVisible() && 43 window->CanReceiveEvents() &&
sky 2012/01/12 21:11:36 One downside of this is that if the lock screen is
oshima 2012/01/12 21:32:50 good point. done.
44 (!aura::client::GetActivationDelegate(window) || 44 (!aura::client::GetActivationDelegate(window) ||
45 aura::client::GetActivationDelegate(window)->ShouldActivate(NULL)) && 45 aura::client::GetActivationDelegate(window)->ShouldActivate(NULL)) &&
46 SupportsChildActivation(window->parent()); 46 SupportsChildActivation(window->parent());
47 } 47 }
48 48
49 // When a modal window is activated, we bring its entire transient parent chain 49 // When a modal window is activated, we bring its entire transient parent chain
50 // to the front. This function must be called before the modal transient is 50 // to the front. This function must be called before the modal transient is
51 // stacked at the top to ensure correct stacking order. 51 // stacked at the top to ensure correct stacking order.
52 void StackTransientParentsBelowModalWindow(aura::Window* window) { 52 void StackTransientParentsBelowModalWindow(aura::Window* window) {
53 if (window->GetIntProperty(aura::client::kModalKey) != ui::MODAL_TYPE_WINDOW) 53 if (window->GetIntProperty(aura::client::kModalKey) != ui::MODAL_TYPE_WINDOW)
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 i != container->children().rend(); 204 i != container->children().rend();
205 ++i) { 205 ++i) {
206 if (*i != ignore && CanActivateWindow(*i)) 206 if (*i != ignore && CanActivateWindow(*i))
207 return *i; 207 return *i;
208 } 208 }
209 return NULL; 209 return NULL;
210 } 210 }
211 211
212 } // namespace internal 212 } // namespace internal
213 } // namespace ash 213 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | ui/aura/root_window.h » ('j') | ui/aura/window.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698