| 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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 * | 572 * |
| 573 * @param {function()} callback Completion callback. | 573 * @param {function()} callback Completion callback. |
| 574 * @private | 574 * @private |
| 575 */ | 575 */ |
| 576 FileManager.prototype.initGeneral_ = function(callback) { | 576 FileManager.prototype.initGeneral_ = function(callback) { |
| 577 // Initialize the application state. | 577 // Initialize the application state. |
| 578 // TODO(mtomasz): Unify window.appState with location.search format. | 578 // TODO(mtomasz): Unify window.appState with location.search format. |
| 579 if (window.appState) { | 579 if (window.appState) { |
| 580 this.params_ = window.appState.params || {}; | 580 this.params_ = window.appState.params || {}; |
| 581 this.initCurrentDirectoryURL_ = window.appState.currentDirectoryURL; | 581 this.initCurrentDirectoryURL_ = window.appState.currentDirectoryURL; |
| 582 this.initSelectionPath_ = window.appState.selectionURL; | 582 this.initSelectionURL_ = window.appState.selectionURL; |
| 583 this.initTargetName_ = window.appState.targetName; | 583 this.initTargetName_ = window.appState.targetName; |
| 584 } else { | 584 } else { |
| 585 // Used by the select dialog only. | 585 // Used by the select dialog only. |
| 586 this.params_ = location.search ? | 586 this.params_ = location.search ? |
| 587 JSON.parse(decodeURIComponent(location.search.substr(1))) : | 587 JSON.parse(decodeURIComponent(location.search.substr(1))) : |
| 588 {}; | 588 {}; |
| 589 this.initCurrentDirectoryURL_ = this.params_.currentDirectoryURL; | 589 this.initCurrentDirectoryURL_ = this.params_.currentDirectoryURL; |
| 590 this.initSelectionURL_ = this.params_.selectionURL; | 590 this.initSelectionURL_ = this.params_.selectionURL; |
| 591 this.initTargetName_ = this.params_.targetName; | 591 this.initTargetName_ = this.params_.targetName; |
| 592 } | 592 } |
| (...skipping 3100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3693 callback(this.preferences_); | 3693 callback(this.preferences_); |
| 3694 return; | 3694 return; |
| 3695 } | 3695 } |
| 3696 | 3696 |
| 3697 chrome.fileBrowserPrivate.getPreferences(function(prefs) { | 3697 chrome.fileBrowserPrivate.getPreferences(function(prefs) { |
| 3698 this.preferences_ = prefs; | 3698 this.preferences_ = prefs; |
| 3699 callback(prefs); | 3699 callback(prefs); |
| 3700 }.bind(this)); | 3700 }.bind(this)); |
| 3701 }; | 3701 }; |
| 3702 })(); | 3702 })(); |
| OLD | NEW |