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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
615 this.syncButton.checkable = true; | 615 this.syncButton.checkable = true; |
616 this.hostedButton.checkable = true; | 616 this.hostedButton.checkable = true; |
617 if (util.platform.newUI()) { | 617 if (util.platform.newUI()) { |
618 this.detailViewButton_.checkable = true; | 618 this.detailViewButton_.checkable = true; |
619 this.thumbnailViewButton_.checkable = true; | 619 this.thumbnailViewButton_.checkable = true; |
620 } | 620 } |
621 }; | 621 }; |
622 | 622 |
623 FileManager.prototype.onMaximize = function() { | 623 FileManager.prototype.onMaximize = function() { |
624 // Do not maximize when running via chrome://files in a browser. | 624 // Do not maximize when running via chrome://files in a browser. |
625 if (!chrome.app.window.contentWindow) | 625 if (!util.platform.runningAsApps()) |
626 return; | 626 return; |
627 | 627 |
628 var appWindow = chrome.app.window.current(); | 628 var appWindow = chrome.app.window.current(); |
629 if (appWindow.isMaximized()) | 629 if (appWindow.isMaximized()) |
630 appWindow.restore(); | 630 appWindow.restore(); |
631 else | 631 else |
632 appWindow.maximize(); | 632 appWindow.maximize(); |
633 }; | 633 }; |
634 | 634 |
635 FileManager.prototype.onClose = function() { | 635 FileManager.prototype.onClose = function() { |
636 // Do not close when running via chrome://files in a browser. | 636 // Do not close when running via chrome://files in a browser. |
637 if (!chrome.app.window.contentWindow) | 637 if (!util.platform.runningAsApps()) |
638 return; | 638 return; |
639 | 639 |
640 window.close(); | 640 window.close(); |
641 }; | 641 }; |
642 | 642 |
643 /** | 643 /** |
644 * One-time initialization of commands. | 644 * One-time initialization of commands. |
645 * @private | 645 * @private |
646 */ | 646 */ |
647 FileManager.prototype.initCommands_ = function() { | 647 FileManager.prototype.initCommands_ = function() { |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
881 if (util.platform.newUI()) { | 881 if (util.platform.newUI()) { |
882 this.dialogDom_.querySelector('#app-name').innerText = | 882 this.dialogDom_.querySelector('#app-name').innerText = |
883 chrome.runtime.getManifest().name; | 883 chrome.runtime.getManifest().name; |
884 } | 884 } |
885 | 885 |
886 this.initDialogType_(); | 886 this.initDialogType_(); |
887 | 887 |
888 // Show the window as soon as the UI pre-initialization is done. | 888 // Show the window as soon as the UI pre-initialization is done. |
889 if (this.dialogType == DialogType.FULL_PAGE && util.platform.v2()) { | 889 if (this.dialogType == DialogType.FULL_PAGE && util.platform.v2()) { |
890 // Do not call show() when running via chrome://files in a browser. | 890 // Do not call show() when running via chrome://files in a browser. |
891 if (chrome.app.window.contentWindow) { | 891 if (util.platform.runningAsApps()) { |
892 chrome.app.window.current().show(); | 892 chrome.app.window.current().show(); |
893 setTimeout(callback, 100); // Wait until the animation is finished. | 893 setTimeout(callback, 100); // Wait until the animation is finished. |
894 } else { | 894 } else { |
895 console.info('Files.app window is not created yet. Maybe launched ' + | 895 console.info('Files.app window is not created yet. Maybe launched ' + |
mtomasz
2013/06/04 06:38:44
Please update the comment or remove it.
yoshiki
2013/06/04 06:57:34
Removed.
| |
896 'via chrome://files in a browser?'); | 896 'via chrome://files in a browser?'); |
897 callback(); | 897 callback(); |
898 } | 898 } |
899 } else { | 899 } else { |
900 callback(); | 900 callback(); |
901 } | 901 } |
902 }; | 902 }; |
903 | 903 |
904 /** | 904 /** |
905 * One-time initialization of dialogs. | 905 * One-time initialization of dialogs. |
(...skipping 3004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3910 * Set the flag expressing whether the ctrl key is pressed or not. | 3910 * Set the flag expressing whether the ctrl key is pressed or not. |
3911 * @param {boolean} flag New value of the flag | 3911 * @param {boolean} flag New value of the flag |
3912 * @private | 3912 * @private |
3913 */ | 3913 */ |
3914 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { | 3914 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { |
3915 this.ctrlKeyPressed_ = flag; | 3915 this.ctrlKeyPressed_ = flag; |
3916 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); | 3916 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); |
3917 this.document_.querySelector('#drive-reload').canExecuteChange(); | 3917 this.document_.querySelector('#drive-reload').canExecuteChange(); |
3918 }; | 3918 }; |
3919 })(); | 3919 })(); |
OLD | NEW |