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
3 // found in the LICENSE file.
5 #include "ash/wm/event_client_impl.h"
8 #include "ash/shell_window_ids.h"
9 #include "ui/aura/window.h"
14 EventClientImpl::EventClientImpl() {
17 EventClientImpl::~EventClientImpl() {
20 bool EventClientImpl::CanProcessEventsWithinSubtree(
21 const aura::Window
* window
) const {
22 const aura::RootWindow
* root_window
=
23 window
? window
->GetRootWindow() : NULL
;
24 if (Shell::GetInstance()->IsScreenLocked() && root_window
) {
25 const aura::Window
* lock_screen_containers
= Shell::GetContainer(
27 kShellWindowId_LockScreenContainersContainer
);
28 const aura::Window
* lock_background_containers
= Shell::GetContainer(
30 kShellWindowId_LockScreenBackgroundContainer
);
31 const aura::Window
* lock_screen_related_containers
= Shell::GetContainer(
33 kShellWindowId_LockScreenRelatedContainersContainer
);
34 return (window
->Contains(lock_screen_containers
) &&
35 window
->Contains(lock_background_containers
) &&
36 window
->Contains(lock_screen_related_containers
)) ||
37 lock_screen_containers
->Contains(window
) ||
38 lock_background_containers
->Contains(window
) ||
39 lock_screen_related_containers
->Contains(window
);
44 ui::EventTarget
* EventClientImpl::GetToplevelEventTarget() {
45 return Shell::GetInstance();
48 } // namespace internal