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

Side by Side Diff: content/browser/renderer_host/input/motion_event_web.cc

Issue 247433003: Mark touchcancel events as uncancelable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
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 "content/browser/renderer_host/input/motion_event_web.h" 5 #include "content/browser/renderer_host/input/motion_event_web.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 using blink::WebInputEvent; 9 using blink::WebInputEvent;
10 using blink::WebTouchEvent; 10 using blink::WebTouchEvent;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 scoped_ptr<ui::MotionEvent> MotionEventWeb::Clone() const { 142 scoped_ptr<ui::MotionEvent> MotionEventWeb::Clone() const {
143 return scoped_ptr<MotionEvent>(new MotionEventWeb(event_)); 143 return scoped_ptr<MotionEvent>(new MotionEventWeb(event_));
144 } 144 }
145 145
146 scoped_ptr<ui::MotionEvent> MotionEventWeb::Cancel() const { 146 scoped_ptr<ui::MotionEvent> MotionEventWeb::Cancel() const {
147 WebTouchEvent cancel_event(event_); 147 WebTouchEvent cancel_event(event_);
148 148
149 cancel_event.type = WebInputEvent::TouchCancel; 149 cancel_event.type = WebInputEvent::TouchCancel;
150 cancel_event.cancelable = false;
150 for (size_t i = 0; i < cancel_event.touchesLength; ++i) 151 for (size_t i = 0; i < cancel_event.touchesLength; ++i)
151 cancel_event.touches[i].state = WebTouchPoint::StateCancelled; 152 cancel_event.touches[i].state = WebTouchPoint::StateCancelled;
152 153
153 return scoped_ptr<MotionEvent>(new MotionEventWeb(cancel_event)); 154 return scoped_ptr<MotionEvent>(new MotionEventWeb(cancel_event));
154 } 155 }
155 156
156 } // namespace content 157 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698