Chromium Code Reviews| Index: telemetry/telemetry/internal/actions/swipe.js |
| diff --git a/telemetry/telemetry/internal/actions/swipe.js b/telemetry/telemetry/internal/actions/swipe.js |
| index 517485c22118f0b4bc5180980929f6ffb8c58559..cc8b03c7d8a005ce7a4c80c64dfa4d6ee974c983 100644 |
| --- a/telemetry/telemetry/internal/actions/swipe.js |
| +++ b/telemetry/telemetry/internal/actions/swipe.js |
| @@ -13,13 +13,19 @@ |
| this.direction_ = opt_options.direction; |
| this.distance_ = opt_options.distance; |
| this.speed_ = opt_options.speed; |
| + this.gesture_source_type_ = opt_options.gesture_source_type; |
| + this.velocity_x_ = opt_options.velocity_x; |
| + this.velocity_y_ = opt_options.velocity_y; |
| } else { |
| this.element_ = document.body; |
| this.left_start_ratio_ = 0.5; |
| this.top_start_ratio_ = 0.5; |
| - this.direction_ = 'left'; |
| + this.direction_ = 'right'; |
| this.distance_ = 0; |
| this.speed_ = 800; |
| + this.gesture_source_type_ = chrome.gpuBenchmarking.DEFAULT_INPUT; |
| + this.velocity_x_ = 0; |
| + this.velocity_y_ = 0; |
| } |
| } |
| @@ -33,8 +39,6 @@ |
| // This class swipes a page for a specified distance. |
| function SwipeAction(opt_callback) { |
| - var self = this; |
| - |
| this.beginMeasuringHook = function() {}; |
| this.endMeasuringHook = function() {}; |
| @@ -53,23 +57,23 @@ |
| this.beginMeasuringHook(); |
| var rect = __GestureCommon_GetBoundingVisibleRect(this.options_.element_); |
| - var start_left = |
| + var startLeft = |
| rect.left + rect.width * this.options_.left_start_ratio_; |
| - var start_top = |
| + var startTop = |
| rect.top + rect.height * this.options_.top_start_ratio_; |
| chrome.gpuBenchmarking.swipe(this.options_.direction_, |
| - this.options_.distance_, |
| - this.onGestureComplete_.bind(this), |
| - start_left, start_top, |
| - this.options_.speed_); |
| + this.options_.distance_, this.onGestureComplete_.bind(this), startLeft, |
| + startTop, this.options_.speed_, this.options_.gesture_source_type_, |
| + this.options_.velocity_x_, this.options_.velocity_y_); |
| }; |
| SwipeAction.prototype.onGestureComplete_ = function() { |
| this.endMeasuringHook(); |
| // We're done. |
| - if (this.callback_) |
| + if (this.callback_) { |
|
nednguyen
2017/04/26 20:17:35
please don't change this in this CL. Style change
|
| this.callback_(); |
| + } |
| }; |
| window.__SwipeAction = SwipeAction; |