OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 goog.provide('image.collections.extension.DocumentVideo'); | 5 goog.provide('image.collections.extension.domextractor.DocumentVideo'); |
6 | 6 |
7 goog.require('image.collections.extension.DocumentFeature'); | 7 goog.require('image.collections.extension.domextractor.DocumentFeature'); |
| 8 goog.require('image.collections.extension.domextractor.DomUtils'); |
8 | 9 |
9 goog.scope(function() { | 10 goog.scope(function() { |
10 var DocumentFeature = image.collections.extension.DocumentFeature; | 11 var DocumentFeature = image.collections.extension.domextractor.DocumentFeature; |
11 | 12 |
12 | 13 |
13 | 14 |
14 /** | 15 /** |
15 * A class representing a salient video in an HTML document. | 16 * A class representing a salient video in an HTML document. |
16 * @param {number} relevance | 17 * @param {number} relevance |
17 * @param {string} url | 18 * @param {string} url |
18 * @param {!goog.math.Size} size | 19 * @param {!image.collections.extension.domextractor.Size} size |
19 * @extends {DocumentFeature} | 20 * @extends {DocumentFeature} |
20 * @constructor | 21 * @constructor |
| 22 * @suppress {undefinedNames} |
21 */ | 23 */ |
22 image.collections.extension.DocumentVideo = function(relevance, url, size) { | 24 image.collections.extension.domextractor.DocumentVideo = |
| 25 function(relevance, url, size) { |
23 DocumentVideo.base(this, 'constructor', relevance); | 26 DocumentVideo.base(this, 'constructor', relevance); |
24 | 27 |
25 /** @private {string} Absolute video url. */ | 28 /** @private {string} Absolute video url. */ |
26 this.url_ = url; | 29 this.url_ = url; |
27 | 30 |
28 /** @private {!goog.math.Size} Video resolution in pixels */ | 31 /** |
| 32 * @private {!image.collections.extension.domextractor.Size} Video resolution |
| 33 * in pixels |
| 34 */ |
29 this.size_ = size; | 35 this.size_ = size; |
30 }; | 36 }; |
31 goog.inherits(image.collections.extension.DocumentVideo, DocumentFeature); | 37 image.collections.extension.domextractor.DomUtils.inherits( |
32 var DocumentVideo = image.collections.extension.DocumentVideo; | 38 image.collections.extension.domextractor.DocumentVideo, DocumentFeature); |
| 39 var DocumentVideo = image.collections.extension.domextractor.DocumentVideo; |
33 | 40 |
34 | 41 |
35 /** @enum {string} */ | 42 /** @enum {string} */ |
36 DocumentVideo.CustomAttribute = { | 43 DocumentVideo.CustomAttribute = { |
37 WIDTH: 'data-google-stars-video-width', | 44 WIDTH: 'data-google-stars-video-width', |
38 HEIGHT: 'data-google-stars-video-height' | 45 HEIGHT: 'data-google-stars-video-height' |
39 }; | 46 }; |
40 | 47 |
41 | 48 |
42 /** | 49 /** |
43 * Returns the absolute video url. | 50 * Returns the absolute video url. |
44 * @return {string} | 51 * @return {string} |
45 */ | 52 */ |
46 DocumentVideo.prototype.getUrl = function() { | 53 DocumentVideo.prototype.getUrl = function() { |
47 return this.url_; | 54 return this.url_; |
48 }; | 55 }; |
49 | 56 |
50 | 57 |
51 /** | 58 /** |
52 * Returns the video resolution in pixels. | 59 * Returns the video resolution in pixels. |
53 * @return {!goog.math.Size} | 60 * @return {!image.collections.extension.domextractor.Size} |
54 */ | 61 */ |
55 DocumentVideo.prototype.getSize = function() { | 62 DocumentVideo.prototype.getSize = function() { |
56 return this.size_; | 63 return this.size_; |
57 }; | 64 }; |
58 }); // goog.scope | 65 }); // goog.scope |
OLD | NEW |