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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * FileManager constructor. | 8 * FileManager constructor. |
9 * | 9 * |
10 * FileManager objects encapsulate the functionality of the file selector | 10 * FileManager objects encapsulate the functionality of the file selector |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
392 controller.attachFileListDropTarget(this.table_.list); | 392 controller.attachFileListDropTarget(this.table_.list); |
393 controller.attachDragSource(this.grid_); | 393 controller.attachDragSource(this.grid_); |
394 controller.attachFileListDropTarget(this.grid_); | 394 controller.attachFileListDropTarget(this.grid_); |
395 controller.attachTreeDropTarget(this.directoryTree_); | 395 controller.attachTreeDropTarget(this.directoryTree_); |
396 controller.attachNavigationListDropTarget(this.navigationList_, true); | 396 controller.attachNavigationListDropTarget(this.navigationList_, true); |
397 controller.attachCopyPasteHandlers(); | 397 controller.attachCopyPasteHandlers(); |
398 controller.addEventListener('selection-copied', | 398 controller.addEventListener('selection-copied', |
399 this.blinkSelection.bind(this)); | 399 this.blinkSelection.bind(this)); |
400 controller.addEventListener('selection-cut', | 400 controller.addEventListener('selection-cut', |
401 this.blinkSelection.bind(this)); | 401 this.blinkSelection.bind(this)); |
402 controller.addEventListener('source-not-found', | |
403 this.onSourceNotFound_.bind(this)); | |
402 }; | 404 }; |
403 | 405 |
404 /** | 406 /** |
407 * Handles an error that the source entry of file operation is not found. | |
408 * @private | |
409 */ | |
410 FileManager.prototype.onSourceNotFound_ = function(event) { | |
411 this.sourceNotFoundErrorCount_ = this.sourceNotFoundErrorCount_ || 0; | |
412 var item = new ProgressCenterItem(); | |
413 item.id = 'source-not-found-' + this.sourceNotFoundErrorCount_; | |
yoshiki
2014/02/14 10:24:11
Please make it sure that sourceNotFoundErrorCount
hirono
2014/02/14 10:42:37
Done.
| |
414 if (event.progressType === ProgressItemType.COPY) | |
415 item.message = strf('COPY_SOURCE_NOT_FOUND_ERROR', event.fileName); | |
416 else if (event.progressType === ProgressItemType.MOVE) | |
417 item.message = strf('MOVE_SOURCE_NOT_FOUND_ERROR', event.fileName); | |
418 item.state = ProgressItemState.ERROR; | |
419 this.backgroundPage_.background.progressCenter.updateItem(item); | |
420 this.sourceNotFoundErrorCount_++; | |
421 }; | |
422 | |
423 /** | |
405 * One-time initialization of context menus. | 424 * One-time initialization of context menus. |
406 * @private | 425 * @private |
407 */ | 426 */ |
408 FileManager.prototype.initContextMenus_ = function() { | 427 FileManager.prototype.initContextMenus_ = function() { |
409 this.fileContextMenu_ = this.dialogDom_.querySelector('#file-context-menu'); | 428 this.fileContextMenu_ = this.dialogDom_.querySelector('#file-context-menu'); |
410 cr.ui.Menu.decorate(this.fileContextMenu_); | 429 cr.ui.Menu.decorate(this.fileContextMenu_); |
411 | 430 |
412 cr.ui.contextMenuHandler.setContextMenu(this.grid_, this.fileContextMenu_); | 431 cr.ui.contextMenuHandler.setContextMenu(this.grid_, this.fileContextMenu_); |
413 cr.ui.contextMenuHandler.setContextMenu(this.table_.querySelector('.list'), | 432 cr.ui.contextMenuHandler.setContextMenu(this.table_.querySelector('.list'), |
414 this.fileContextMenu_); | 433 this.fileContextMenu_); |
(...skipping 3281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3696 callback(this.preferences_); | 3715 callback(this.preferences_); |
3697 return; | 3716 return; |
3698 } | 3717 } |
3699 | 3718 |
3700 chrome.fileBrowserPrivate.getPreferences(function(prefs) { | 3719 chrome.fileBrowserPrivate.getPreferences(function(prefs) { |
3701 this.preferences_ = prefs; | 3720 this.preferences_ = prefs; |
3702 callback(prefs); | 3721 callback(prefs); |
3703 }.bind(this)); | 3722 }.bind(this)); |
3704 }; | 3723 }; |
3705 })(); | 3724 })(); |
OLD | NEW |