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

Side by Side Diff: content/common/input/synthetic_web_input_event_builders.cc

Issue 739013008: Explicitly suppress scrolling for wheel events that will trigger zooming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modify event_sender.cc Created 5 years, 11 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/common/input/synthetic_web_input_event_builders.h" 5 #include "content/common/input/synthetic_web_input_event_builders.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/common/input/web_touch_event_traits.h" 8 #include "content/common/input/web_touch_event_traits.h"
9 #include "ui/events/keycodes/keyboard_codes.h" 9 #include "ui/events/keycodes/keyboard_codes.h"
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 WebMouseWheelEvent result; 61 WebMouseWheelEvent result;
62 result.type = WebInputEvent::MouseWheel; 62 result.type = WebInputEvent::MouseWheel;
63 result.deltaX = dx; 63 result.deltaX = dx;
64 result.deltaY = dy; 64 result.deltaY = dy;
65 if (dx) 65 if (dx)
66 result.wheelTicksX = dx > 0.0f ? 1.0f : -1.0f; 66 result.wheelTicksX = dx > 0.0f ? 1.0f : -1.0f;
67 if (dy) 67 if (dy)
68 result.wheelTicksY = dy > 0.0f ? 1.0f : -1.0f; 68 result.wheelTicksY = dy > 0.0f ? 1.0f : -1.0f;
69 result.modifiers = modifiers; 69 result.modifiers = modifiers;
70 result.hasPreciseScrollingDeltas = precise; 70 result.hasPreciseScrollingDeltas = precise;
71 result.canScroll = true;
71 return result; 72 return result;
72 } 73 }
73 74
74 WebKeyboardEvent SyntheticWebKeyboardEventBuilder::Build( 75 WebKeyboardEvent SyntheticWebKeyboardEventBuilder::Build(
75 WebInputEvent::Type type) { 76 WebInputEvent::Type type) {
76 DCHECK(WebInputEvent::isKeyboardEventType(type)); 77 DCHECK(WebInputEvent::isKeyboardEventType(type));
77 WebKeyboardEvent result; 78 WebKeyboardEvent result;
78 result.type = type; 79 result.type = type;
79 result.windowsKeyCode = ui::VKEY_L; // non-null made up value. 80 result.windowsKeyCode = ui::VKEY_L; // non-null made up value.
80 return result; 81 return result;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 touches[index].state = WebTouchPoint::StateCancelled; 211 touches[index].state = WebTouchPoint::StateCancelled;
211 WebTouchEventTraits::ResetType( 212 WebTouchEventTraits::ResetType(
212 WebInputEvent::TouchCancel, timeStampSeconds, this); 213 WebInputEvent::TouchCancel, timeStampSeconds, this);
213 } 214 }
214 215
215 void SyntheticWebTouchEvent::SetTimestamp(base::TimeDelta timestamp) { 216 void SyntheticWebTouchEvent::SetTimestamp(base::TimeDelta timestamp) {
216 timeStampSeconds = timestamp.InSecondsF(); 217 timeStampSeconds = timestamp.InSecondsF();
217 } 218 }
218 219
219 } // namespace content 220 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl_unittest.cc ('k') | content/common/input/web_input_event_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698