OLD | NEW |
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" | |
8 #include "ash/shell.h" | 7 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
10 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
11 | 10 |
12 namespace ash { | 11 namespace ash { |
13 namespace internal { | 12 namespace internal { |
14 | 13 |
15 EventClientImpl::EventClientImpl() { | 14 EventClientImpl::EventClientImpl() { |
16 } | 15 } |
17 | 16 |
18 EventClientImpl::~EventClientImpl() { | 17 EventClientImpl::~EventClientImpl() { |
19 } | 18 } |
20 | 19 |
21 bool EventClientImpl::CanProcessEventsWithinSubtree( | 20 bool EventClientImpl::CanProcessEventsWithinSubtree( |
22 const aura::Window* window) const { | 21 const aura::Window* window) const { |
23 const aura::RootWindow* root_window = | 22 const aura::RootWindow* root_window = |
24 window ? window->GetRootWindow() : NULL; | 23 window ? window->GetRootWindow() : NULL; |
25 if (Shell::GetInstance()->session_state_delegate()->IsScreenLocked() && | 24 if (Shell::GetInstance()->IsScreenLocked() && root_window) { |
26 root_window) { | |
27 const aura::Window* lock_screen_containers = Shell::GetContainer( | 25 const aura::Window* lock_screen_containers = Shell::GetContainer( |
28 root_window, | 26 root_window, |
29 kShellWindowId_LockScreenContainersContainer); | 27 kShellWindowId_LockScreenContainersContainer); |
30 const aura::Window* lock_background_containers = Shell::GetContainer( | 28 const aura::Window* lock_background_containers = Shell::GetContainer( |
31 root_window, | 29 root_window, |
32 kShellWindowId_LockScreenBackgroundContainer); | 30 kShellWindowId_LockScreenBackgroundContainer); |
33 const aura::Window* lock_screen_related_containers = Shell::GetContainer( | 31 const aura::Window* lock_screen_related_containers = Shell::GetContainer( |
34 root_window, | 32 root_window, |
35 kShellWindowId_LockScreenRelatedContainersContainer); | 33 kShellWindowId_LockScreenRelatedContainersContainer); |
36 return (window->Contains(lock_screen_containers) && | 34 return (window->Contains(lock_screen_containers) && |
37 window->Contains(lock_background_containers) && | 35 window->Contains(lock_background_containers) && |
38 window->Contains(lock_screen_related_containers)) || | 36 window->Contains(lock_screen_related_containers)) || |
39 lock_screen_containers->Contains(window) || | 37 lock_screen_containers->Contains(window) || |
40 lock_background_containers->Contains(window) || | 38 lock_background_containers->Contains(window) || |
41 lock_screen_related_containers->Contains(window); | 39 lock_screen_related_containers->Contains(window); |
42 } | 40 } |
43 return true; | 41 return true; |
44 } | 42 } |
45 | 43 |
46 ui::EventTarget* EventClientImpl::GetToplevelEventTarget() { | 44 ui::EventTarget* EventClientImpl::GetToplevelEventTarget() { |
47 return Shell::GetInstance(); | 45 return Shell::GetInstance(); |
48 } | 46 } |
49 | 47 |
50 } // namespace internal | 48 } // namespace internal |
51 } // namespace ash | 49 } // namespace ash |
OLD | NEW |