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/overlay_event_filter.h" | 5 #include "ash/wm/overlay_event_filter.h" |
6 | 6 |
7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
8 #include "ui/aura/window_delegate.h" | 8 #include "ui/aura/window_delegate.h" |
9 #include "ui/events/event.h" | 9 #include "ui/events/event.h" |
10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 Cancel(); | 27 Cancel(); |
28 | 28 |
29 // Pass key events only when they are sent to a child of the delegate's | 29 // Pass key events only when they are sent to a child of the delegate's |
30 // window. | 30 // window. |
31 aura::Window* target = static_cast<aura::Window*>(event->target()); | 31 aura::Window* target = static_cast<aura::Window*>(event->target()); |
32 if (!delegate_ || !delegate_->GetWindow() || | 32 if (!delegate_ || !delegate_->GetWindow() || |
33 !delegate_->GetWindow()->Contains(target)) | 33 !delegate_->GetWindow()->Contains(target)) |
34 event->StopPropagation(); | 34 event->StopPropagation(); |
35 } | 35 } |
36 | 36 |
37 void OverlayEventFilter::OnLoginStateChanged( | 37 void OverlayEventFilter::OnLoginStateChanged(LoginStatus status) { |
38 user::LoginStatus status) { | |
39 Cancel(); | 38 Cancel(); |
40 } | 39 } |
41 | 40 |
42 void OverlayEventFilter::OnAppTerminating() { | 41 void OverlayEventFilter::OnAppTerminating() { |
43 Cancel(); | 42 Cancel(); |
44 } | 43 } |
45 | 44 |
46 void OverlayEventFilter::OnLockStateChanged(bool locked) { | 45 void OverlayEventFilter::OnLockStateChanged(bool locked) { |
47 Cancel(); | 46 Cancel(); |
48 } | 47 } |
(...skipping 14 matching lines...) Expand all Loading... |
63 delegate_->Cancel(); | 62 delegate_->Cancel(); |
64 delegate_ = nullptr; | 63 delegate_ = nullptr; |
65 } | 64 } |
66 } | 65 } |
67 | 66 |
68 bool OverlayEventFilter::IsActive() { | 67 bool OverlayEventFilter::IsActive() { |
69 return delegate_ != nullptr; | 68 return delegate_ != nullptr; |
70 } | 69 } |
71 | 70 |
72 } // namespace ash | 71 } // namespace ash |
OLD | NEW |