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 /** | 5 /** |
6 * @param {!Element} container Content container. | 6 * @param {!Element} container Content container. |
7 * @param {!ErrorBanner} errorBanner Error banner. | 7 * @param {!ErrorBanner} errorBanner Error banner. |
8 * @param {!cr.ui.ArrayDataModel} dataModel Data model. | 8 * @param {!cr.ui.ArrayDataModel} dataModel Data model. |
9 * @param {!cr.ui.ListSelectionModel} selectionModel Selection model. | 9 * @param {!cr.ui.ListSelectionModel} selectionModel Selection model. |
10 * @param {!VolumeManager} volumeManager Volume manager. | 10 * @param {!VolumeManager} volumeManager Volume manager. |
11 * @param {function()} toggleMode Function to switch to the Slide mode. | 11 * @param {function(Event=)} toggleMode Function to switch to the Slide mode. |
12 * @constructor | 12 * @constructor |
13 * @struct | 13 * @struct |
14 */ | 14 */ |
15 function MosaicMode( | 15 function MosaicMode( |
16 container, errorBanner, dataModel, selectionModel, volumeManager, | 16 container, errorBanner, dataModel, selectionModel, volumeManager, |
17 toggleMode) { | 17 toggleMode) { |
18 this.mosaic_ = new Mosaic(assert(container.ownerDocument), errorBanner, | 18 this.mosaic_ = new Mosaic(assert(container.ownerDocument), errorBanner, |
19 dataModel, selectionModel, volumeManager); | 19 dataModel, selectionModel, volumeManager); |
20 container.appendChild(this.mosaic_); | 20 container.appendChild(this.mosaic_); |
21 | 21 |
(...skipping 2260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2282 return new ImageRect(this.left_ - this.container_.scrollLeft, this.top_, | 2282 return new ImageRect(this.left_ - this.container_.scrollLeft, this.top_, |
2283 this.width_, this.height_).inflate(-margin, -margin); | 2283 this.width_, this.height_).inflate(-margin, -margin); |
2284 }; | 2284 }; |
2285 | 2285 |
2286 /** | 2286 /** |
2287 * @return {number} X coordinate of the tile center. | 2287 * @return {number} X coordinate of the tile center. |
2288 */ | 2288 */ |
2289 Mosaic.Tile.prototype.getCenterX = function() { | 2289 Mosaic.Tile.prototype.getCenterX = function() { |
2290 return this.left_ + Math.round(this.width_ / 2); | 2290 return this.left_ + Math.round(this.width_ / 2); |
2291 }; | 2291 }; |
OLD | NEW |