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 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2003 * | 2003 * |
2004 * @return {boolean} Returns true if the connection is offline. Otherwise, | 2004 * @return {boolean} Returns true if the connection is offline. Otherwise, |
2005 * returns false. | 2005 * returns false. |
2006 */ | 2006 */ |
2007 FileManager.prototype.isDriveOffline = function() { | 2007 FileManager.prototype.isDriveOffline = function() { |
2008 var connection = this.volumeManager_.getDriveConnectionState(); | 2008 var connection = this.volumeManager_.getDriveConnectionState(); |
2009 return connection.type == VolumeManager.DriveConnectionType.OFFLINE; | 2009 return connection.type == VolumeManager.DriveConnectionType.OFFLINE; |
2010 }; | 2010 }; |
2011 | 2011 |
2012 FileManager.prototype.isDriveEnabled = function() { | 2012 FileManager.prototype.isDriveEnabled = function() { |
2013 // TODO(kinaba): Remove the "!shouldReturnLocalPath &&" condition once | 2013 // Auto resolving to local path does not work for folders (e.g., dialog for |
2014 // crbug.com/140425 is done. | 2014 // loading unpacked extensions) and saving. |
2015 return !this.params_.shouldReturnLocalPath && | 2015 // TODO(kinaba): make it work for the save dialog http://crbug.com/140425 |
2016 (!('driveEnabled' in this.preferences_) || | 2016 var noLocalPathResolution = |
2017 this.preferences_.driveEnabled); | 2017 this.params_.type == DialogType.SELECT_SAVEAS_FILE || |
| 2018 this.params_.type == DialogType.SELECT_FOLDER || |
| 2019 this.params_.type == DialogType.SELECT_UPLOAD_FOLDER; |
| 2020 if (noLocalPathResolution && this.params_.shouldReturnLocalPath) |
| 2021 return false; |
| 2022 return this.preferences_.driveEnabled; |
2018 }; | 2023 }; |
2019 | 2024 |
2020 FileManager.prototype.isOnReadonlyDirectory = function() { | 2025 FileManager.prototype.isOnReadonlyDirectory = function() { |
2021 return this.directoryModel_.isReadOnly(); | 2026 return this.directoryModel_.isReadOnly(); |
2022 }; | 2027 }; |
2023 | 2028 |
2024 /** | 2029 /** |
2025 * @param {Event} Unmount event. | 2030 * @param {Event} Unmount event. |
2026 * @private | 2031 * @private |
2027 */ | 2032 */ |
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3868 */ | 3873 */ |
3869 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { | 3874 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { |
3870 this.ctrlKeyPressed_ = flag; | 3875 this.ctrlKeyPressed_ = flag; |
3871 // Before the DOM is constructed, the key event can be handled. | 3876 // Before the DOM is constructed, the key event can be handled. |
3872 var cacheClearCommand = | 3877 var cacheClearCommand = |
3873 this.document_.querySelector('#drive-clear-local-cache'); | 3878 this.document_.querySelector('#drive-clear-local-cache'); |
3874 if (cacheClearCommand) | 3879 if (cacheClearCommand) |
3875 cacheClearCommand.canExecuteChange(); | 3880 cacheClearCommand.canExecuteChange(); |
3876 }; | 3881 }; |
3877 })(); | 3882 })(); |
OLD | NEW |