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

Side by Side Diff: ui/aura/window_event_dispatcher.cc

Issue 489213003: Prevent double acking of ignored touches (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to calling StopPropagation on ignored events. Created 6 years, 4 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 | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/aura/window_event_dispatcher.h" 5 #include "ui/aura/window_event_dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 default: 886 default:
887 NOTREACHED(); 887 NOTREACHED();
888 break; 888 break;
889 } 889 }
890 890
891 if (dispatching_held_event_ || !held_move_event_ || 891 if (dispatching_held_event_ || !held_move_event_ ||
892 !held_move_event_->IsTouchEvent()) { 892 !held_move_event_->IsTouchEvent()) {
893 ui::TouchEvent orig_event(*event, target, window()); 893 ui::TouchEvent orig_event(*event, target, window());
894 894
895 // If the touch event is invalid in some way, the gesture recognizer will 895 // If the touch event is invalid in some way, the gesture recognizer will
896 // reject it. In this case, stop the touch from reaching the next event 896 // reject it. This must call |StopPropagation()|, in order to prevent the
897 // phase. 897 // touch from being acked in |PostDispatchEvent|.
898 if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch(orig_event, 898 if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch(orig_event,
899 target)) { 899 target)) {
900 event->SetHandled(); 900 event->StopPropagation();
901 } 901 }
902 } 902 }
903 903
904 PreDispatchLocatedEvent(target, event); 904 PreDispatchLocatedEvent(target, event);
905 } 905 }
906 906
907 } // namespace aura 907 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698