| 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" |
| 11 | 11 |
| 12 namespace ash { | 12 namespace ash { |
| 13 | 13 |
| 14 OverlayEventFilter::OverlayEventFilter() | 14 OverlayEventFilter::OverlayEventFilter() : delegate_(NULL) {} |
| 15 : delegate_(NULL) { | |
| 16 } | |
| 17 | 15 |
| 18 OverlayEventFilter::~OverlayEventFilter() { | 16 OverlayEventFilter::~OverlayEventFilter() { |
| 19 delegate_ = NULL; | 17 delegate_ = NULL; |
| 20 } | 18 } |
| 21 | 19 |
| 22 void OverlayEventFilter::OnKeyEvent(ui::KeyEvent* event) { | 20 void OverlayEventFilter::OnKeyEvent(ui::KeyEvent* event) { |
| 23 if (!delegate_) | 21 if (!delegate_) |
| 24 return; | 22 return; |
| 25 | 23 |
| 26 if (delegate_ && delegate_->IsCancelingKeyEvent(event)) | 24 if (delegate_ && delegate_->IsCancelingKeyEvent(event)) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 delegate_->Cancel(); | 60 delegate_->Cancel(); |
| 63 delegate_ = nullptr; | 61 delegate_ = nullptr; |
| 64 } | 62 } |
| 65 } | 63 } |
| 66 | 64 |
| 67 bool OverlayEventFilter::IsActive() { | 65 bool OverlayEventFilter::IsActive() { |
| 68 return delegate_ != nullptr; | 66 return delegate_ != nullptr; |
| 69 } | 67 } |
| 70 | 68 |
| 71 } // namespace ash | 69 } // namespace ash |
| OLD | NEW |