OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 document.addEventListener('DOMContentLoaded', function() { | 5 document.addEventListener('DOMContentLoaded', function() { |
6 PhotoImport.load(); | 6 PhotoImport.load(); |
7 }); | 7 }); |
8 | 8 |
9 /** | 9 /** |
10 * The main Photo App object. | 10 * The main Photo App object. |
11 * @param {HTMLElement} dom Container. | 11 * @param {HTMLElement} dom Container. |
12 * @param {FileSystem} filesystem Local file system. | 12 * @param {FileSystem} filesystem Local file system. |
13 * @param {Object} params Parameters. | 13 * @param {Object} params Parameters. |
14 * @constructor | 14 * @constructor |
15 */ | 15 */ |
16 function PhotoImport(dom, filesystem, params) { | 16 function PhotoImport(dom, filesystem, params) { |
17 this.filesystem_ = filesystem; | 17 this.filesystem_ = filesystem; |
18 this.dom_ = dom; | 18 this.dom_ = dom; |
19 this.document_ = this.dom_.ownerDocument; | 19 this.document_ = this.dom_.ownerDocument; |
20 this.metadataCache_ = params.metadataCache; | 20 this.metadataCache_ = params.metadataCache; |
21 this.volumeManager_ = new VolumeManager(); | 21 this.volumeManager_ = new VolumeManager(); |
22 this.copyManager_ = new FileCopyManager(this.filesystem_.root); | 22 this.copyManager_ = FileCopyManagerWrapper.getInstance(this.filesystem_.root); |
23 this.mediaFilesList_ = null; | 23 this.mediaFilesList_ = null; |
24 this.albums_ = null; | 24 this.albums_ = null; |
25 this.albumsDir_ = null; | 25 this.albumsDir_ = null; |
26 | 26 |
27 this.initDom_(); | 27 this.initDom_(); |
28 this.initAlbums_(); | 28 this.initAlbums_(); |
29 this.loadSource_(params.source); | 29 this.loadSource_(params.source); |
30 } | 30 } |
31 | 31 |
32 PhotoImport.prototype = { __proto__: cr.EventTarget.prototype }; | 32 PhotoImport.prototype = { __proto__: cr.EventTarget.prototype }; |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 | 552 |
553 /** @inheritDoc */ | 553 /** @inheritDoc */ |
554 GridSelectionController.prototype.getLastIndex = function() { | 554 GridSelectionController.prototype.getLastIndex = function() { |
555 var dm = this.grid_.dataModel; | 555 var dm = this.grid_.dataModel; |
556 for (var index = dm.length - 1; index >= 0; index--) { | 556 for (var index = dm.length - 1; index >= 0; index--) { |
557 if (dm.item(index).type == 'entry') | 557 if (dm.item(index).type == 'entry') |
558 return index; | 558 return index; |
559 } | 559 } |
560 return -1; | 560 return -1; |
561 }; | 561 }; |
OLD | NEW |