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/key_rewriter_event_filter.h" | 5 #include "ash/wm/key_rewriter_event_filter.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ash/key_rewriter_delegate.h" | 8 #include "ash/key_rewriter_delegate.h" |
9 #include "ui/aura/event.h" | 9 #include "ui/aura/event.h" |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 case KeyRewriterDelegate::ACTION_DROP_EVENT: | 37 case KeyRewriterDelegate::ACTION_DROP_EVENT: |
38 return true; | 38 return true; |
39 } | 39 } |
40 | 40 |
41 NOTREACHED(); | 41 NOTREACHED(); |
42 return false; | 42 return false; |
43 } | 43 } |
44 | 44 |
45 bool KeyRewriterEventFilter::PreHandleMouseEvent( | 45 bool KeyRewriterEventFilter::PreHandleMouseEvent( |
46 aura::Window* target, aura::MouseEvent* event) { | 46 aura::Window* target, aura::MouseEvent* event) { |
47 return false; // Not handled. | 47 if (!delegate_.get()) |
| 48 return false; |
| 49 |
| 50 switch (delegate_->RewriteOrFilterLocatedEvent(event)) { |
| 51 case KeyRewriterDelegate::ACTION_REWRITE_EVENT: |
| 52 return false; |
| 53 case KeyRewriterDelegate::ACTION_DROP_EVENT: |
| 54 return true; |
| 55 } |
| 56 |
| 57 NOTREACHED(); |
| 58 return false; |
48 } | 59 } |
49 | 60 |
50 ui::TouchStatus KeyRewriterEventFilter::PreHandleTouchEvent( | 61 ui::TouchStatus KeyRewriterEventFilter::PreHandleTouchEvent( |
51 aura::Window* target, aura::TouchEvent* event) { | 62 aura::Window* target, aura::TouchEvent* event) { |
52 return ui::TOUCH_STATUS_UNKNOWN; // Not handled. | 63 return ui::TOUCH_STATUS_UNKNOWN; // Not handled. |
53 } | 64 } |
54 | 65 |
55 ui::GestureStatus KeyRewriterEventFilter::PreHandleGestureEvent( | 66 ui::GestureStatus KeyRewriterEventFilter::PreHandleGestureEvent( |
56 aura::Window* target, aura::GestureEvent* event) { | 67 aura::Window* target, aura::GestureEvent* event) { |
57 return ui::GESTURE_STATUS_UNKNOWN; // Not handled. | 68 return ui::GESTURE_STATUS_UNKNOWN; // Not handled. |
58 } | 69 } |
59 | 70 |
60 } // namespace internal | 71 } // namespace internal |
61 } // namespace ash | 72 } // namespace ash |
OLD | NEW |