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

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

Issue 10756003: Apply Ash's key rewriter to an aura::MouseEvent so that Modifler+Click is handled correctly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years, 5 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
« no previous file with comments | « ash/key_rewriter_delegate.h ('k') | chrome/browser/ui/views/ash/key_rewriter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
OLDNEW
« no previous file with comments | « ash/key_rewriter_delegate.h ('k') | chrome/browser/ui/views/ash/key_rewriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698