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

Side by Side Diff: ash/wm/event_client_impl.cc

Issue 18850003: Focus kept on login screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test fixed. Created 7 years, 5 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/event_client_impl.h" 5 #include "ash/wm/event_client_impl.h"
6 6
7 #include "ash/session_state_delegate.h" 7 #include "ash/session_state_delegate.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
11 11
12 namespace ash { 12 namespace ash {
13 namespace internal { 13 namespace internal {
14 14
15 EventClientImpl::EventClientImpl() { 15 EventClientImpl::EventClientImpl() {
16 } 16 }
17 17
18 EventClientImpl::~EventClientImpl() { 18 EventClientImpl::~EventClientImpl() {
19 } 19 }
20 20
21 bool EventClientImpl::CanProcessEventsWithinSubtree( 21 bool EventClientImpl::CanProcessEventsWithinSubtree(
22 const aura::Window* window) const { 22 const aura::Window* window) const {
23 const aura::RootWindow* root_window = 23 const aura::RootWindow* root_window = window ? window->GetRootWindow() : NULL;
24 window ? window->GetRootWindow() : NULL; 24 if (!root_window)
25 if (Shell::GetInstance()->session_state_delegate()->IsScreenLocked() && 25 return true;
26 root_window) { 26 ash::SessionStateDelegate* state_delegate =
27 Shell::GetInstance()->session_state_delegate();
28 if (!state_delegate->IsActiveUserSessionStarted() ||
29 state_delegate->IsScreenLocked()) {
27 const aura::Window* lock_screen_containers = Shell::GetContainer( 30 const aura::Window* lock_screen_containers = Shell::GetContainer(
28 root_window, 31 root_window,
29 kShellWindowId_LockScreenContainersContainer); 32 kShellWindowId_LockScreenContainersContainer);
30 const aura::Window* lock_background_containers = Shell::GetContainer( 33 const aura::Window* lock_background_containers = Shell::GetContainer(
31 root_window, 34 root_window,
32 kShellWindowId_LockScreenBackgroundContainer); 35 kShellWindowId_LockScreenBackgroundContainer);
33 const aura::Window* lock_screen_related_containers = Shell::GetContainer( 36 const aura::Window* lock_screen_related_containers = Shell::GetContainer(
34 root_window, 37 root_window,
35 kShellWindowId_LockScreenRelatedContainersContainer); 38 kShellWindowId_LockScreenRelatedContainersContainer);
36 return (window->Contains(lock_screen_containers) && 39 return (window->Contains(lock_screen_containers) &&
37 window->Contains(lock_background_containers) && 40 window->Contains(lock_background_containers) &&
38 window->Contains(lock_screen_related_containers)) || 41 window->Contains(lock_screen_related_containers)) ||
39 lock_screen_containers->Contains(window) || 42 lock_screen_containers->Contains(window) ||
40 lock_background_containers->Contains(window) || 43 lock_background_containers->Contains(window) ||
41 lock_screen_related_containers->Contains(window); 44 lock_screen_related_containers->Contains(window);
42 } 45 }
43 return true; 46 return true;
44 } 47 }
45 48
46 ui::EventTarget* EventClientImpl::GetToplevelEventTarget() { 49 ui::EventTarget* EventClientImpl::GetToplevelEventTarget() {
47 return Shell::GetInstance(); 50 return Shell::GetInstance();
48 } 51 }
49 52
50 } // namespace internal 53 } // namespace internal
51 } // namespace ash 54 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller_unittest.cc ('k') | chrome/browser/chromeos/policy/device_local_account_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698