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

Unified Diff: chrome/browser/resources/pdf/gesture_detector.js

Issue 2939273002: DO NOT SUBMIT: what chrome/browser/resources/ could eventually look like with clang-format (Closed)
Patch Set: Created 3 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: chrome/browser/resources/pdf/gesture_detector.js
diff --git a/chrome/browser/resources/pdf/gesture_detector.js b/chrome/browser/resources/pdf/gesture_detector.js
index d73a85b7a3b17dae00d94b5ef19d172ab0251963..811bfe28b5b6b9ab73483857be1b1f0e733024d6 100644
--- a/chrome/browser/resources/pdf/gesture_detector.js
+++ b/chrome/browser/resources/pdf/gesture_detector.js
@@ -20,20 +20,20 @@ class GestureDetector {
this.element_.addEventListener(
'touchstart',
/** @type {function(!Event)} */ (this.onTouchStart_.bind(this)),
- { passive: true });
+ {passive: true});
this.element_.addEventListener(
'touchmove',
/** @type {function(!Event)} */ (this.onTouch_.bind(this)),
- { passive: false });
+ {passive: false});
this.element_.addEventListener(
'touchend',
/** @type {function(!Event)} */ (this.onTouch_.bind(this)),
- { passive: true });
+ {passive: true});
this.element_.addEventListener(
'touchcancel',
/** @type {function(!Event)} */ (this.onTouch_.bind(this)),
- { passive: true });
+ {passive: true});
this.pinchStartEvent_ = null;
this.lastTouchTouchesCount_ = 0;
@@ -42,11 +42,8 @@ class GestureDetector {
this.lastEvent_ = null;
/** @private {!Map<string, !Array<!Function>>} */
- this.listeners_ = new Map([
- ['pinchstart', []],
- ['pinchupdate', []],
- ['pinchend', []]
- ]);
+ this.listeners_ =
+ new Map([['pinchstart', []], ['pinchupdate', []], ['pinchend', []]]);
}
/**
@@ -92,10 +89,7 @@ class GestureDetector {
this.pinchStartEvent_ = event;
this.lastEvent_ = event;
- this.notify_({
- type: 'pinchstart',
- center: GestureDetector.center_(event)
- });
+ this.notify_({type: 'pinchstart', center: GestureDetector.center_(event)});
}
/**
@@ -112,8 +106,8 @@ class GestureDetector {
// Check if the pinch ends with the current event.
if (event.touches.length < 2 ||
lastEvent.touches.length !== event.touches.length) {
- let startScaleRatio = GestureDetector.pinchScaleRatio_(
- lastEvent, this.pinchStartEvent_);
+ let startScaleRatio =
+ GestureDetector.pinchScaleRatio_(lastEvent, this.pinchStartEvent_);
let center = GestureDetector.center_(lastEvent);
let endEvent = {
type: 'pinchend',
@@ -131,8 +125,8 @@ class GestureDetector {
event.preventDefault();
let scaleRatio = GestureDetector.pinchScaleRatio_(event, lastEvent);
- let startScaleRatio = GestureDetector.pinchScaleRatio_(
- event, this.pinchStartEvent_);
+ let startScaleRatio =
+ GestureDetector.pinchScaleRatio_(event, this.pinchStartEvent_);
let center = GestureDetector.center_(event);
this.notify_({
type: 'pinchupdate',

Powered by Google App Engine
This is Rietveld 408576698