Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 22523003: Enable Google Drive in all save-file dialogs of Chrome OS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/extensions/file_manager/private_api_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1997 matching lines...) Expand 10 before | Expand all | Expand 10 after
2008 * @return {boolean} Returns true if the connection is offline. Otherwise, 2008 * @return {boolean} Returns true if the connection is offline. Otherwise,
2009 * returns false. 2009 * returns false.
2010 */ 2010 */
2011 FileManager.prototype.isDriveOffline = function() { 2011 FileManager.prototype.isDriveOffline = function() {
2012 var connection = this.volumeManager_.getDriveConnectionState(); 2012 var connection = this.volumeManager_.getDriveConnectionState();
2013 return connection.type == VolumeManager.DriveConnectionType.OFFLINE; 2013 return connection.type == VolumeManager.DriveConnectionType.OFFLINE;
2014 }; 2014 };
2015 2015
2016 FileManager.prototype.isDriveEnabled = function() { 2016 FileManager.prototype.isDriveEnabled = function() {
2017 // Auto resolving to local path does not work for folders (e.g., dialog for 2017 // Auto resolving to local path does not work for folders (e.g., dialog for
2018 // loading unpacked extensions) and saving. 2018 // loading unpacked extensions).
2019 // TODO(kinaba): make it work for the save dialog http://crbug.com/140425
2020 var noLocalPathResolution = 2019 var noLocalPathResolution =
2021 this.params_.type == DialogType.SELECT_SAVEAS_FILE ||
2022 this.params_.type == DialogType.SELECT_FOLDER || 2020 this.params_.type == DialogType.SELECT_FOLDER ||
2023 this.params_.type == DialogType.SELECT_UPLOAD_FOLDER; 2021 this.params_.type == DialogType.SELECT_UPLOAD_FOLDER;
2024 if (noLocalPathResolution && this.params_.shouldReturnLocalPath) 2022 if (noLocalPathResolution && this.params_.shouldReturnLocalPath)
2025 return false; 2023 return false;
2026 return this.preferences_.driveEnabled; 2024 return this.preferences_.driveEnabled;
2027 }; 2025 };
2028 2026
2029 FileManager.prototype.isOnReadonlyDirectory = function() { 2027 FileManager.prototype.isOnReadonlyDirectory = function() {
2030 return this.directoryModel_.isReadOnly(); 2028 return this.directoryModel_.isReadOnly();
2031 }; 2029 };
(...skipping 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after
3877 */ 3875 */
3878 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { 3876 FileManager.prototype.setCtrlKeyPressed_ = function(flag) {
3879 this.ctrlKeyPressed_ = flag; 3877 this.ctrlKeyPressed_ = flag;
3880 // Before the DOM is constructed, the key event can be handled. 3878 // Before the DOM is constructed, the key event can be handled.
3881 var cacheClearCommand = 3879 var cacheClearCommand =
3882 this.document_.querySelector('#drive-clear-local-cache'); 3880 this.document_.querySelector('#drive-clear-local-cache');
3883 if (cacheClearCommand) 3881 if (cacheClearCommand)
3884 cacheClearCommand.canExecuteChange(); 3882 cacheClearCommand.canExecuteChange();
3885 }; 3883 };
3886 })(); 3884 })();
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/extensions/file_manager/private_api_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698