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

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

Issue 11047030: Decouple EventClientImpl and root window. Check containers on the same root window as focused windo… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 8 years, 2 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/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"
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(aura::RootWindow* root_window) 14 EventClientImpl::EventClientImpl() {
16 : root_window_(root_window) {
17 aura::client::SetEventClient(root_window_, this);
18 } 15 }
19 16
20 EventClientImpl::~EventClientImpl() { 17 EventClientImpl::~EventClientImpl() {
21 aura::client::SetEventClient(root_window_, NULL);
22 } 18 }
23 19
24 bool EventClientImpl::CanProcessEventsWithinSubtree( 20 bool EventClientImpl::CanProcessEventsWithinSubtree(
25 const aura::Window* window) const { 21 const aura::Window* window) const {
26 if (Shell::GetInstance()->IsScreenLocked()) { 22 aura::RootWindow* root_window = window ?
23 const_cast<aura::RootWindow*>(window->GetRootWindow()) : NULL;
oshima 2012/10/06 06:57:36 GetContainer doesn't change the state of root wind
Daniel Erat 2012/10/06 14:00:19 can you just make GetContainer() take a const wind
oshima 2012/10/06 17:20:58 It returns non const aura::Window*, so we can't ju
24 if (Shell::GetInstance()->IsScreenLocked() && root_window) {
27 aura::Window* lock_screen_containers = Shell::GetContainer( 25 aura::Window* lock_screen_containers = Shell::GetContainer(
28 root_window_, 26 root_window,
29 kShellWindowId_LockScreenContainersContainer); 27 kShellWindowId_LockScreenContainersContainer);
30 aura::Window* lock_background_containers = Shell::GetContainer( 28 aura::Window* lock_background_containers = Shell::GetContainer(
31 root_window_, 29 root_window,
32 kShellWindowId_LockScreenBackgroundContainer); 30 kShellWindowId_LockScreenBackgroundContainer);
33 aura::Window* lock_screen_related_containers = Shell::GetContainer( 31 aura::Window* lock_screen_related_containers = Shell::GetContainer(
34 root_window_, 32 root_window,
35 kShellWindowId_LockScreenRelatedContainersContainer); 33 kShellWindowId_LockScreenRelatedContainersContainer);
36 return lock_screen_containers->Contains(window) || 34 return lock_screen_containers->Contains(window) ||
37 lock_background_containers->Contains(window) || 35 lock_background_containers->Contains(window) ||
38 lock_screen_related_containers->Contains(window); 36 lock_screen_related_containers->Contains(window);
39 } 37 }
40 return true; 38 return true;
41 } 39 }
42 40
43 } // namespace internal 41 } // namespace internal
44 } // namespace ash 42 } // namespace ash
OLDNEW
« ash/accelerators/accelerator_controller.cc ('K') | « ash/wm/event_client_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698