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

Side by Side Diff: ui/events/blink/input_scroll_elasticity_controller.cc

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 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
« no previous file with comments | « ui/events/blink/input_handler_proxy_unittest.cc ('k') | ui/events/blink/web_input_event.cc » ('j') | 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/events/blink/input_scroll_elasticity_controller.h" 5 #include "ui/events/blink/input_scroll_elasticity_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 if (helper_) 104 if (helper_)
105 return weak_factory_.GetWeakPtr(); 105 return weak_factory_.GetWeakPtr();
106 return base::WeakPtr<InputScrollElasticityController>(); 106 return base::WeakPtr<InputScrollElasticityController>();
107 } 107 }
108 108
109 void InputScrollElasticityController::ObserveGestureEventAndResult( 109 void InputScrollElasticityController::ObserveGestureEventAndResult(
110 const blink::WebGestureEvent& gesture_event, 110 const blink::WebGestureEvent& gesture_event,
111 const cc::InputHandlerScrollResult& scroll_result) { 111 const cc::InputHandlerScrollResult& scroll_result) {
112 base::TimeTicks event_timestamp = 112 base::TimeTicks event_timestamp =
113 base::TimeTicks() + 113 base::TimeTicks() +
114 base::TimeDelta::FromSecondsD(gesture_event.timeStampSeconds); 114 base::TimeDelta::FromSecondsD(gesture_event.timeStampSeconds());
115 115
116 switch (gesture_event.type) { 116 switch (gesture_event.type()) {
117 case blink::WebInputEvent::GestureScrollBegin: { 117 case blink::WebInputEvent::GestureScrollBegin: {
118 if (gesture_event.data.scrollBegin.synthetic) 118 if (gesture_event.data.scrollBegin.synthetic)
119 return; 119 return;
120 if (gesture_event.data.scrollBegin.inertialPhase == 120 if (gesture_event.data.scrollBegin.inertialPhase ==
121 blink::WebGestureEvent::MomentumPhase) { 121 blink::WebGestureEvent::MomentumPhase) {
122 if (state_ == kStateInactive) 122 if (state_ == kStateInactive)
123 state_ = kStateMomentumScroll; 123 state_ = kStateMomentumScroll;
124 } else if (gesture_event.data.scrollBegin.inertialPhase == 124 } else if (gesture_event.data.scrollBegin.inertialPhase ==
125 blink::WebGestureEvent::NonMomentumPhase && 125 blink::WebGestureEvent::NonMomentumPhase &&
126 gesture_event.data.scrollBegin.deltaHintUnits == 126 gesture_event.data.scrollBegin.deltaHintUnits ==
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 break; 417 break;
418 default: 418 default:
419 // These cases should not be hit because the stretch must be zero in the 419 // These cases should not be hit because the stretch must be zero in the
420 // Inactive and MomentumScroll states. 420 // Inactive and MomentumScroll states.
421 NOTREACHED(); 421 NOTREACHED();
422 break; 422 break;
423 } 423 }
424 } 424 }
425 425
426 } // namespace ui 426 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/blink/input_handler_proxy_unittest.cc ('k') | ui/events/blink/web_input_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698