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

Side by Side Diff: telemetry/telemetry/internal/actions/scroll_bounce.js

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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 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 'use strict'; 5 'use strict';
6 6
7 (function() { 7 (function() {
8 function supportedByBrowser() { 8 function supportedByBrowser() {
9 return !!(window.chrome && 9 return !!(window.chrome &&
10 chrome.gpuBenchmarking && 10 chrome.gpuBenchmarking &&
11 chrome.gpuBenchmarking.scrollBounce); 11 chrome.gpuBenchmarking.scrollBounce &&
12 chrome.gpuBenchmarking.visualViewportHeight &&
13 chrome.gpuBenchmarking.visualViewportWidth);
12 } 14 }
13 15
14 function ScrollBounceAction(opt_callback) { 16 function ScrollBounceAction(opt_callback) {
15 var self = this; 17 var self = this;
16 18
17 this.beginMeasuringHook = function() {} 19 this.beginMeasuringHook = function() {};
18 this.endMeasuringHook = function() {} 20 this.endMeasuringHook = function() {};
19 21
20 this.callback_ = opt_callback; 22 this.callback_ = opt_callback;
21 } 23 }
22 24
23 ScrollBounceAction.prototype.start = function(options) { 25 ScrollBounceAction.prototype.start = function(options) {
24 this.options_ = options; 26 this.options_ = options;
25 // Assign this.element_ here instead of constructor, because the constructor 27 // Assign this.element_ here instead of constructor, because the constructor
26 // ensures this method will be called after the document is loaded. 28 // ensures this method will be called after the document is loaded.
27 this.element_ = this.options_.element; 29 this.element_ = this.options_.element;
28 requestAnimationFrame(this.startGesture_.bind(this)); 30 requestAnimationFrame(this.startGesture_.bind(this));
(...skipping 20 matching lines...) Expand all
49 this.endMeasuringHook(); 51 this.endMeasuringHook();
50 52
51 // We're done. 53 // We're done.
52 if (this.callback_) 54 if (this.callback_)
53 this.callback_(); 55 this.callback_();
54 }; 56 };
55 57
56 window.__ScrollBounceAction = ScrollBounceAction; 58 window.__ScrollBounceAction = ScrollBounceAction;
57 window.__ScrollBounceAction_SupportedByBrowser = supportedByBrowser; 59 window.__ScrollBounceAction_SupportedByBrowser = supportedByBrowser;
58 })(); 60 })();
OLDNEW
« no previous file with comments | « telemetry/telemetry/internal/actions/scroll.py ('k') | telemetry/telemetry/internal/actions/scroll_bounce.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698