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 var MAX_DRAG_THUMBAIL_COUNT = 4; | 5 var MAX_DRAG_THUMBAIL_COUNT = 4; |
6 | 6 |
| 7 /** |
| 8 * TODO(olege): Fix style warnings. |
| 9 */ |
7 function FileTransferController(fileList, | 10 function FileTransferController(fileList, |
8 fileListSelection, | 11 fileListSelection, |
9 dragNodeConstructor, | 12 dragNodeConstructor, |
10 copyManager, | 13 copyManager, |
11 directoryModel) { | 14 directoryModel) { |
12 this.fileList_ = fileList; | 15 this.fileList_ = fileList; |
13 this.fileListSelection_ = fileListSelection; | 16 this.fileListSelection_ = fileListSelection; |
14 this.dragNodeConstructor_ = dragNodeConstructor; | 17 this.dragNodeConstructor_ = dragNodeConstructor; |
15 this.copyManager_ = copyManager; | 18 this.copyManager_ = copyManager; |
16 this.directoryModel_ = directoryModel; | 19 this.directoryModel_ = directoryModel; |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 370 |
368 // Items to drag are created in advance. Images must be loaded | 371 // Items to drag are created in advance. Images must be loaded |
369 // at the time the 'dragstart' event comes. Otherwise draggable | 372 // at the time the 'dragstart' event comes. Otherwise draggable |
370 // image will be rendered without IMG tags. | 373 // image will be rendered without IMG tags. |
371 if (dragNodes.length < MAX_DRAG_THUMBAIL_COUNT) | 374 if (dragNodes.length < MAX_DRAG_THUMBAIL_COUNT) |
372 dragNodes.push(new this.dragNodeConstructor_(entries[i])); | 375 dragNodes.push(new this.dragNodeConstructor_(entries[i])); |
373 } | 376 } |
374 }, | 377 }, |
375 | 378 |
376 get currentDirectory() { | 379 get currentDirectory() { |
377 return this.directoryModel_.currentEntry; | 380 return this.directoryModel_.getCurrentDirEntry(); |
378 }, | 381 }, |
379 | 382 |
380 get readonly() { | 383 get readonly() { |
381 return this.directoryModel_.readonly; | 384 return this.directoryModel_.isReadOnly(); |
382 }, | 385 }, |
383 | 386 |
384 get isOnGData() { | 387 get isOnGData() { |
385 return this.directoryModel_.rootType == DirectoryModel.RootType.GDATA; | 388 return this.directoryModel_.getRootType() == DirectoryModel.RootType.GDATA; |
386 }, | 389 }, |
387 | 390 |
388 notify_: function(eventName) { | 391 notify_: function(eventName) { |
389 var self = this; | 392 var self = this; |
390 // Set timeout to avoid recursive events. | 393 // Set timeout to avoid recursive events. |
391 setTimeout(function() { | 394 setTimeout(function() { |
392 cr.dispatchSimpleEvent(self, eventName); | 395 cr.dispatchSimpleEvent(self, eventName); |
393 }, 0); | 396 }, 0); |
394 }, | 397 }, |
395 | 398 |
396 /** | 399 /** |
397 * @type {Array.<Entry>} | 400 * @type {Array.<Entry>} |
398 */ | 401 */ |
399 get selectedEntries_() { | 402 get selectedEntries_() { |
400 var list = this.fileList_; | 403 var list = this.fileList_; |
401 return this.fileListSelection_.selectedIndexes.map(function(index) { | 404 return this.fileListSelection_.selectedIndexes.map(function(index) { |
402 return list.item(index); | 405 return list.item(index); |
403 }); | 406 }); |
404 } | 407 } |
405 }; | 408 }; |
406 | 409 |
OLD | NEW |