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 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2011 * | 2011 * |
2012 * @return {boolean} Returns true if the connection is offline. Otherwise, | 2012 * @return {boolean} Returns true if the connection is offline. Otherwise, |
2013 * returns false. | 2013 * returns false. |
2014 */ | 2014 */ |
2015 FileManager.prototype.isDriveOffline = function() { | 2015 FileManager.prototype.isDriveOffline = function() { |
2016 var connection = this.volumeManager_.getDriveConnectionState(); | 2016 var connection = this.volumeManager_.getDriveConnectionState(); |
2017 return connection.type == VolumeManager.DriveConnectionType.OFFLINE; | 2017 return connection.type == VolumeManager.DriveConnectionType.OFFLINE; |
2018 }; | 2018 }; |
2019 | 2019 |
2020 FileManager.prototype.isDriveEnabled = function() { | 2020 FileManager.prototype.isDriveEnabled = function() { |
2021 // TODO(kinaba): Remove the "!shouldReturnLocalPath &&" condition once | 2021 // Auto resolving to local path does not work for folders (e.g., dialog for |
2022 // crbug.com/140425 is done. | 2022 // loading unpacked extensions) and saving. |
2023 return !this.params_.shouldReturnLocalPath && | 2023 // TODO(kinaba): remove it from the save dialog http://crbug.com/140425 |
2024 var noLocalPathResolution = | |
2025 this.params_.type == DialogType.SELECT_SAVEAS_FILE || | |
2026 this.params_.type == DialogType.SELECT_FOLDER || | |
2027 this.params_.type == DialogType.SELECT_UPLOAD_FOLDER; | |
2028 var clientCanHandleDrive = | |
satorux1
2013/08/06 02:07:17
Maybe return here?
if (noLocalPathResolution && t
kinaba
2013/08/06 06:20:56
Done.
| |
2029 !(noLocalPathResolution && this.params_.shouldReturnLocalPath); | |
2030 | |
2031 return clientCanHandleDrive && | |
2024 (!('driveEnabled' in this.preferences_) || | 2032 (!('driveEnabled' in this.preferences_) || |
satorux1
2013/08/06 02:07:17
Should we check this ('driveEnabled' not in this.p
kinaba
2013/08/06 06:20:56
Done.
| |
2025 this.preferences_.driveEnabled); | 2033 this.preferences_.driveEnabled); |
2026 }; | 2034 }; |
2027 | 2035 |
2028 FileManager.prototype.isOnReadonlyDirectory = function() { | 2036 FileManager.prototype.isOnReadonlyDirectory = function() { |
2029 return this.directoryModel_.isReadOnly(); | 2037 return this.directoryModel_.isReadOnly(); |
2030 }; | 2038 }; |
2031 | 2039 |
2032 /** | 2040 /** |
2033 * @param {Event} Unmount event. | 2041 * @param {Event} Unmount event. |
2034 * @private | 2042 * @private |
(...skipping 1833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3868 */ | 3876 */ |
3869 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { | 3877 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { |
3870 this.ctrlKeyPressed_ = flag; | 3878 this.ctrlKeyPressed_ = flag; |
3871 // Before the DOM is constructed, the key event can be handled. | 3879 // Before the DOM is constructed, the key event can be handled. |
3872 var cacheClearCommand = | 3880 var cacheClearCommand = |
3873 this.document_.querySelector('#drive-clear-local-cache'); | 3881 this.document_.querySelector('#drive-clear-local-cache'); |
3874 if (cacheClearCommand) | 3882 if (cacheClearCommand) |
3875 cacheClearCommand.canExecuteChange(); | 3883 cacheClearCommand.canExecuteChange(); |
3876 }; | 3884 }; |
3877 })(); | 3885 })(); |
OLD | NEW |