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