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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 this.table_.setDateTimeFormat(use12hourClock); | 377 this.table_.setDateTimeFormat(use12hourClock); |
378 }; | 378 }; |
379 | 379 |
380 /** | 380 /** |
381 * @private | 381 * @private |
382 */ | 382 */ |
383 FileManager.prototype.initDataTransferOperations_ = function() { | 383 FileManager.prototype.initDataTransferOperations_ = function() { |
384 this.fileOperationManager_ = FileOperationManagerWrapper.getInstance( | 384 this.fileOperationManager_ = FileOperationManagerWrapper.getInstance( |
385 this.backgroundPage_); | 385 this.backgroundPage_); |
386 | 386 |
387 this.butterBar_ = new ButterBar( | 387 // CopyManager are required for 'Delete' operation in |
388 this.dialogDom_, this.fileOperationManager_); | |
389 | |
390 // CopyManager and ButterBar are required for 'Delete' operation in | |
391 // Open and Save dialogs. But drag-n-drop and copy-paste are not needed. | 388 // Open and Save dialogs. But drag-n-drop and copy-paste are not needed. |
392 if (this.dialogType != DialogType.FULL_PAGE) return; | 389 if (this.dialogType != DialogType.FULL_PAGE) return; |
393 | 390 |
394 // TODO(hidehiko): Extract FileOperationManager related code from | 391 // TODO(hidehiko): Extract FileOperationManager related code from |
395 // FileManager to simplify it. | 392 // FileManager to simplify it. |
396 this.onCopyProgressBound_ = this.onCopyProgress_.bind(this); | 393 this.onCopyProgressBound_ = this.onCopyProgress_.bind(this); |
397 this.fileOperationManager_.addEventListener( | 394 this.fileOperationManager_.addEventListener( |
398 'copy-progress', this.onCopyProgressBound_); | 395 'copy-progress', this.onCopyProgressBound_); |
399 | 396 |
400 this.onEntryChangedBound_ = this.onEntryChanged_.bind(this); | 397 this.onEntryChangedBound_ = this.onEntryChanged_.bind(this); |
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2272 */ | 2269 */ |
2273 FileManager.prototype.onUnload_ = function() { | 2270 FileManager.prototype.onUnload_ = function() { |
2274 if (this.directoryModel_) | 2271 if (this.directoryModel_) |
2275 this.directoryModel_.dispose(); | 2272 this.directoryModel_.dispose(); |
2276 if (this.volumeManager_) | 2273 if (this.volumeManager_) |
2277 this.volumeManager_.dispose(); | 2274 this.volumeManager_.dispose(); |
2278 if (this.filePopup_ && | 2275 if (this.filePopup_ && |
2279 this.filePopup_.contentWindow && | 2276 this.filePopup_.contentWindow && |
2280 this.filePopup_.contentWindow.unload) | 2277 this.filePopup_.contentWindow.unload) |
2281 this.filePopup_.contentWindow.unload(true /* exiting */); | 2278 this.filePopup_.contentWindow.unload(true /* exiting */); |
2282 if (this.butterBar_) | |
2283 this.butterBar_.dispose(); | |
2284 if (this.progressCenterPanel_) | 2279 if (this.progressCenterPanel_) |
2285 this.backgroundPage_.background.progressCenter.removePanel( | 2280 this.backgroundPage_.background.progressCenter.removePanel( |
2286 this.progressCenterPanel_); | 2281 this.progressCenterPanel_); |
2287 if (this.fileOperationManager_) { | 2282 if (this.fileOperationManager_) { |
2288 if (this.onCopyProgressBound_) { | 2283 if (this.onCopyProgressBound_) { |
2289 this.fileOperationManager_.removeEventListener( | 2284 this.fileOperationManager_.removeEventListener( |
2290 'copy-progress', this.onCopyProgressBound_); | 2285 'copy-progress', this.onCopyProgressBound_); |
2291 } | 2286 } |
2292 if (this.onEntryChangedBound_) { | 2287 if (this.onEntryChangedBound_) { |
2293 this.fileOperationManager_.removeEventListener( | 2288 this.fileOperationManager_.removeEventListener( |
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3566 callback(this.preferences_); | 3561 callback(this.preferences_); |
3567 return; | 3562 return; |
3568 } | 3563 } |
3569 | 3564 |
3570 chrome.fileBrowserPrivate.getPreferences(function(prefs) { | 3565 chrome.fileBrowserPrivate.getPreferences(function(prefs) { |
3571 this.preferences_ = prefs; | 3566 this.preferences_ = prefs; |
3572 callback(prefs); | 3567 callback(prefs); |
3573 }.bind(this)); | 3568 }.bind(this)); |
3574 }; | 3569 }; |
3575 })(); | 3570 })(); |
OLD | NEW |