| 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 "ash/wm/partial_screenshot_view.h" | 7 #include "ash/wm/partial_screenshot_view.h" |
| 8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
| 9 #include "ui/aura/window_delegate.h" | 9 #include "ui/aura/window_delegate.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 void OverlayEventFilter::OnAppTerminating() { | 50 void OverlayEventFilter::OnAppTerminating() { |
| 51 Cancel(); | 51 Cancel(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void OverlayEventFilter::OnLockStateChanged(bool locked) { | 54 void OverlayEventFilter::OnLockStateChanged(bool locked) { |
| 55 Cancel(); | 55 Cancel(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void OverlayEventFilter::Activate(Delegate* delegate) { | 58 void OverlayEventFilter::Activate(Delegate* delegate) { |
| 59 if (delegate_) |
| 60 delegate_->Cancel(); |
| 59 delegate_ = delegate; | 61 delegate_ = delegate; |
| 60 } | 62 } |
| 61 | 63 |
| 62 void OverlayEventFilter::Deactivate() { | 64 void OverlayEventFilter::Deactivate(Delegate* delegate) { |
| 63 delegate_ = NULL; | 65 if (delegate_ == delegate) |
| 66 delegate_ = NULL; |
| 64 } | 67 } |
| 65 | 68 |
| 66 void OverlayEventFilter::Cancel() { | 69 void OverlayEventFilter::Cancel() { |
| 67 if (delegate_) | 70 if (delegate_) |
| 68 delegate_->Cancel(); | 71 delegate_->Cancel(); |
| 69 } | 72 } |
| 70 | 73 |
| 74 bool OverlayEventFilter::IsActive() { |
| 75 return delegate_; |
| 76 } |
| 77 |
| 71 } // namespace ash | 78 } // namespace ash |
| OLD | NEW |