Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 cr.define('print_preview', function() { | 5 cr.define('print_preview', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Modal dialog base component. | 9 * Modal dialog base component. |
| 10 * @param {!print_preview.MetricsContext} metricsContext Metrics | |
| 11 * context to record usage statistics. | |
| 12 * @constructor | 10 * @constructor |
| 13 * @extends {print_preview.Component} | 11 * @extends {print_preview.Component} |
| 14 */ | 12 */ |
| 15 function Overlay(metricsContext) { | 13 function Overlay() { |
| 16 print_preview.Component.call(this); | 14 print_preview.Component.call(this); |
| 17 | |
| 18 /** @private {!print_preview.MetricsContext} */ | |
| 19 this.metricsContext_ = metricsContext; | |
| 20 }; | 15 }; |
|
Dan Beam
2014/09/24 23:31:21
nit: remove ;
Vitaly Pavlenko
2014/09/24 23:57:07
Done.
| |
| 21 | 16 |
| 22 Overlay.prototype = { | 17 Overlay.prototype = { |
| 23 __proto__: print_preview.Component.prototype, | 18 __proto__: print_preview.Component.prototype, |
| 24 | 19 |
| 25 /** @return {!print_preview.MetricsContext} */ | |
| 26 get metricsContext() { | |
| 27 return this.metricsContext_; | |
| 28 }, | |
| 29 | |
| 30 /** @override */ | 20 /** @override */ |
| 31 enterDocument: function() { | 21 enterDocument: function() { |
| 32 print_preview.Component.prototype.enterDocument.call(this); | 22 print_preview.Component.prototype.enterDocument.call(this); |
| 33 | 23 |
| 34 this.getElement().addEventListener('webkitTransitionEnd', function f(e) { | 24 this.getElement().addEventListener('webkitTransitionEnd', function f(e) { |
| 35 if (e.target == e.currentTarget && e.propertyName == 'opacity' && | 25 if (e.target == e.currentTarget && e.propertyName == 'opacity' && |
| 36 e.target.classList.contains('transparent')) { | 26 e.target.classList.contains('transparent')) { |
| 37 setIsVisible(e.target, false); | 27 setIsVisible(e.target, false); |
| 38 } | 28 } |
| 39 }); | 29 }); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 if (e.target && e.animationName == 'pulse') | 123 if (e.target && e.animationName == 'pulse') |
| 134 e.target.classList.remove('pulse'); | 124 e.target.classList.remove('pulse'); |
| 135 } | 125 } |
| 136 }; | 126 }; |
| 137 | 127 |
| 138 // Export | 128 // Export |
| 139 return { | 129 return { |
| 140 Overlay: Overlay | 130 Overlay: Overlay |
| 141 }; | 131 }; |
| 142 }); | 132 }); |
| OLD | NEW |