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

Unified Diff: content/common/input/web_input_event_traits.cc

Issue 2052663004: Remove canScroll from WebMouseWheelEvent as it is unused now. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: content/common/input/web_input_event_traits.cc
diff --git a/content/common/input/web_input_event_traits.cc b/content/common/input/web_input_event_traits.cc
index c94a2d40c9b1e170e412a954c1e0462e5e5dde5f..d94ed17138d2aefe01d71af856a83260cddd923f 100644
--- a/content/common/input/web_input_event_traits.cc
+++ b/content/common/input/web_input_event_traits.cc
@@ -55,23 +55,15 @@ void ApppendEventDetails(const WebMouseEvent& event, std::string* result) {
}
void ApppendEventDetails(const WebMouseWheelEvent& event, std::string* result) {
- StringAppendF(result,
- "{\n Delta: (%f, %f)\n WheelTicks: (%f, %f)\n Accel: (%f, %f)\n"
- " ScrollByPage: %d\n HasPreciseScrollingDeltas: %d\n"
- " Phase: (%d, %d)\n CanRubberband: (%d, %d)\n CanScroll: %d\n}",
- event.deltaX,
- event.deltaY,
- event.wheelTicksX,
- event.wheelTicksY,
- event.accelerationRatioX,
- event.accelerationRatioY,
- event.scrollByPage,
- event.hasPreciseScrollingDeltas,
- event.phase,
- event.momentumPhase,
- event.canRubberbandLeft,
- event.canRubberbandRight,
- event.canScroll);
+ StringAppendF(
+ result,
+ "{\n Delta: (%f, %f)\n WheelTicks: (%f, %f)\n Accel: (%f, %f)\n"
+ " ScrollByPage: %d\n HasPreciseScrollingDeltas: %d\n"
+ " Phase: (%d, %d)\n CanRubberband: (%d, %d)\n}",
+ event.deltaX, event.deltaY, event.wheelTicksX, event.wheelTicksY,
+ event.accelerationRatioX, event.accelerationRatioY, event.scrollByPage,
+ event.hasPreciseScrollingDeltas, event.phase, event.momentumPhase,
+ event.canRubberbandLeft, event.canRubberbandRight);
}
void ApppendEventDetails(const WebGestureEvent& event, std::string* result) {
@@ -153,8 +145,7 @@ bool CanCoalesce(const WebMouseWheelEvent& event_to_coalesce,
event.phase == event_to_coalesce.phase &&
event.momentumPhase == event_to_coalesce.momentumPhase &&
event.hasPreciseScrollingDeltas ==
- event_to_coalesce.hasPreciseScrollingDeltas &&
- event.canScroll == event_to_coalesce.canScroll;
+ event_to_coalesce.hasPreciseScrollingDeltas;
}
float GetUnacceleratedDelta(float accelerated_delta, float acceleration_ratio) {
@@ -525,6 +516,18 @@ bool WebInputEventTraits::ShouldBlockEventStream(const WebInputEvent& event) {
}
}
+bool WebInputEventTraits::ShouldCauseScroll(
+ const blink::WebMouseWheelEvent& event) {
+#if defined(USE_AURA)
+ // Scroll events generated from the mouse wheel when the control key is held
+ // don't trigger scrolling. Instead, they may cause zooming.
+ return event.hasPreciseScrollingDeltas ||
tdresser 2016/06/10 18:06:46 Don't we also zoom in on touchpad + ctrl?
dtapuska 2016/06/10 19:11:17 We only zoom on low precision touch pads; not high
+ (event.modifiers & blink::WebInputEvent::ControlKey) == 0;
+#else
+ return true;
+#endif
+}
+
uint32_t WebInputEventTraits::GetUniqueTouchEventId(
const WebInputEvent& event) {
if (WebInputEvent::isTouchEventType(event.type)) {

Powered by Google App Engine
This is Rietveld 408576698