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

Unified Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 12221132: filemanager: Fix GetDriveConnectionStateFunctionChange to return "offline" when DriveSystemService … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: refactor the if-clause Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/extensions/file_browser_private_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/file_manager.js
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index 3c517ef56be058fb2a20d98edd7e2ab3c17ded1e..34143740fbafc3851b7e2c647cbafe35a83775e7 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -126,8 +126,9 @@ var DriveConnectionType = {
* @enum {string}
*/
var DriveConnectionReason = {
- NOT_READY: 'not_ready', // Drive is not ready or authentication is failed.
+ NOT_READY: 'not_ready', // Drive is not ready or authentication is failed.
NO_NETWORK: 'no_network', // Network connection is unavailable.
+ NO_SERVICE: 'no_service' // Drive service is unavailable.
};
/**
@@ -1685,8 +1686,8 @@ DialogType.isModal = function(type) {
done();
});
- chrome.fileBrowserPrivate.getDriveConnectionState(function(networkState) {
- self.networkState_ = networkState;
+ chrome.fileBrowserPrivate.getDriveConnectionState(function(state) {
+ self.driveConnectionState_ = state;
done();
});
};
@@ -1695,13 +1696,13 @@ DialogType.isModal = function(type) {
var self = this;
this.updateNetworkStateAndPreferences_(function() {
var drive = self.preferences_;
- var network = self.networkState_;
+ var connection = self.driveConnectionState_;
self.initDateTimeFormatters_();
self.refreshCurrentDirectoryMetadata_();
self.directoryModel_.setDriveEnabled(self.isDriveEnabled());
- self.directoryModel_.setDriveOffline(network.type == 'offline');
+ self.directoryModel_.setDriveOffline(connection.type == 'offline');
if (drive.cellularDisabled)
self.syncButton.setAttribute('checked', '');
@@ -1718,7 +1719,7 @@ DialogType.isModal = function(type) {
else
self.hostedButton.removeAttribute('checked');
- switch (network.type) {
+ switch (connection.type) {
case DriveConnectionType.ONLINE:
self.dialogContainer_.removeAttribute('connection');
break;
@@ -1735,14 +1736,14 @@ DialogType.isModal = function(type) {
};
/**
- * Get the metered status of network.
+ * Get the metered status of Drive connection.
*
* @return {boolean} Returns true if drive should limit the traffic because
* the connection is metered and the 'disable-sync-on-metered' setting is
* enabled. Otherwise, returns false.
*/
FileManager.prototype.isDriveOnMeteredConnection = function() {
- return this.networkState_.type == DriveConnectionType.METERED;
+ return this.driveConnectionState_.type == DriveConnectionType.METERED;
};
/**
@@ -1752,7 +1753,7 @@ DialogType.isModal = function(type) {
* returns false.
*/
FileManager.prototype.isDriveOffline = function() {
- return this.networkState_.type == DriveConnectionType.OFFLINE;
+ return this.driveConnectionState_.type == DriveConnectionType.OFFLINE;
};
FileManager.prototype.isDriveEnabled = function() {
« no previous file with comments | « chrome/browser/chromeos/extensions/file_browser_private_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698