Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / ash / wm / event_client_impl.cc
blob241f5144028295d782f5274f8f5c185f0f34bc94
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"
7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h"
9 #include "ui/aura/window.h"
11 namespace ash {
12 namespace internal {
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(
26 root_window,
27 kShellWindowId_LockScreenContainersContainer);
28 const aura::Window* lock_background_containers = Shell::GetContainer(
29 root_window,
30 kShellWindowId_LockScreenBackgroundContainer);
31 const aura::Window* lock_screen_related_containers = Shell::GetContainer(
32 root_window,
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);
41 return true;
44 ui::EventTarget* EventClientImpl::GetToplevelEventTarget() {
45 return Shell::GetInstance();
48 } // namespace internal
49 } // namespace ash