Chromium Code Reviews| 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 * This variable is checked in SelectFileDialogExtensionBrowserTest. | 8 * This variable is checked in SelectFileDialogExtensionBrowserTest. |
| 9 * @type {number} | 9 * @type {number} |
| 10 */ | 10 */ |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 618 var commands = this.dialogDom_.querySelectorAll('command'); | 618 var commands = this.dialogDom_.querySelectorAll('command'); |
| 619 for (var i = 0; i < commands.length; i++) | 619 for (var i = 0; i < commands.length; i++) |
| 620 cr.ui.Command.decorate(commands[i]); | 620 cr.ui.Command.decorate(commands[i]); |
| 621 | 621 |
| 622 var doc = this.document_; | 622 var doc = this.document_; |
| 623 | 623 |
| 624 CommandUtil.registerCommand(doc, 'newfolder', | 624 CommandUtil.registerCommand(doc, 'newfolder', |
| 625 Commands.newFolderCommand, this, this.directoryModel_); | 625 Commands.newFolderCommand, this, this.directoryModel_); |
| 626 | 626 |
| 627 CommandUtil.registerCommand(doc, 'newwindow', | 627 CommandUtil.registerCommand(doc, 'newwindow', |
| 628 Commands.newWindowCommand, this); | 628 Commands.newWindowCommand, this, this.directoryModel_); |
| 629 | 629 |
| 630 CommandUtil.registerCommand(doc, 'change-default-app', | 630 CommandUtil.registerCommand(doc, 'change-default-app', |
| 631 Commands.changeDefaultAppCommand, this); | 631 Commands.changeDefaultAppCommand, this); |
| 632 | 632 |
| 633 CommandUtil.registerCommand(this.volumeList_, 'unmount', | 633 CommandUtil.registerCommand(this.volumeList_, 'unmount', |
| 634 Commands.unmountCommand, this.volumeList_, this); | 634 Commands.unmountCommand, this.volumeList_, this); |
| 635 | 635 |
| 636 CommandUtil.registerCommand(this.volumeList_, 'import-photos', | 636 CommandUtil.registerCommand(this.volumeList_, 'import-photos', |
| 637 Commands.importCommand, this.volumeList_); | 637 Commands.importCommand, this.volumeList_); |
| 638 | 638 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 783 callback(); | 783 callback(); |
| 784 }; | 784 }; |
| 785 | 785 |
| 786 /** | 786 /** |
| 787 * One time initialization of strings (mostly i18n). | 787 * One time initialization of strings (mostly i18n). |
| 788 * | 788 * |
| 789 * @param {function()} callback Completion callback. | 789 * @param {function()} callback Completion callback. |
| 790 * @private | 790 * @private |
| 791 */ | 791 */ |
| 792 FileManager.prototype.initStrings_ = function(callback) { | 792 FileManager.prototype.initStrings_ = function(callback) { |
| 793 chrome.fileBrowserPrivate.getStrings(function(strings) { | 793 chrome.storage.local.get('strings', function(items) { |
|
yoshiki
2013/06/27 10:25:40
If Files.app is launched via chrome://files (it me
mtomasz
2013/06/27 10:26:57
Good catch. I'll fix it. We need the strings here,
mtomasz
2013/06/27 12:03:09
Done.
| |
| 794 loadTimeData.data = strings; | 794 loadTimeData.data = items['strings']; |
| 795 this.loadTimeDataAvailable = true; | |
| 796 callback(); | 795 callback(); |
| 797 }); | 796 }); |
| 798 }; | 797 }; |
| 799 | 798 |
| 800 /** | 799 /** |
| 801 * One time initialization of the Files.app's essential UI elements. These | 800 * One time initialization of the Files.app's essential UI elements. These |
| 802 * elements will be shown to the user. Only visible elements should be | 801 * elements will be shown to the user. Only visible elements should be |
| 803 * initialized here. Any heavy operation should be avoided. Files.app's | 802 * initialized here. Any heavy operation should be avoided. Files.app's |
| 804 * window is shown at the end of this routine. | 803 * window is shown at the end of this routine. |
| 805 * | 804 * |
| (...skipping 3002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3808 * Set the flag expressing whether the ctrl key is pressed or not. | 3807 * Set the flag expressing whether the ctrl key is pressed or not. |
| 3809 * @param {boolean} flag New value of the flag | 3808 * @param {boolean} flag New value of the flag |
| 3810 * @private | 3809 * @private |
| 3811 */ | 3810 */ |
| 3812 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { | 3811 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { |
| 3813 this.ctrlKeyPressed_ = flag; | 3812 this.ctrlKeyPressed_ = flag; |
| 3814 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); | 3813 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); |
| 3815 this.document_.querySelector('#drive-reload').canExecuteChange(); | 3814 this.document_.querySelector('#drive-reload').canExecuteChange(); |
| 3816 }; | 3815 }; |
| 3817 })(); | 3816 })(); |
| OLD | NEW |