OLD | NEW |
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 Loading... |
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 |
OLD | NEW |