| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /** | 5 /** |
| 6 * Handler of the background page for the drive sync events. | 6 * Handler of the background page for the drive sync events. |
| 7 * @param {ProgressCenter} progressCenter Progress center to submit the | 7 * @param {ProgressCenter} progressCenter Progress center to submit the |
| 8 * progressing items. | 8 * progressing items. |
| 9 * @constructor | 9 * @constructor |
| 10 * @extends {cr.EventTarget} | 10 * @extends {cr.EventTarget} |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 /** | 99 /** |
| 100 * @return {boolean} Whether the handler is having syncing items or not. | 100 * @return {boolean} Whether the handler is having syncing items or not. |
| 101 */ | 101 */ |
| 102 get syncing() { | 102 get syncing() { |
| 103 return this.syncing_; | 103 return this.syncing_; |
| 104 } | 104 } |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 /** | 107 /** |
| 108 * Returns whether the drive sync is currently suppressed or not. | 108 * Returns whether the drive sync is currently suppressed or not. |
| 109 * @private | |
| 110 * @return {boolean} | 109 * @return {boolean} |
| 111 */ | 110 */ |
| 112 DriveSyncHandler.prototype.isSyncSuppressed = function() { | 111 DriveSyncHandler.prototype.isSyncSuppressed = function() { |
| 113 return navigator.connection.type === 'cellular' && | 112 return navigator.connection.type === 'cellular' && |
| 114 this.cellularDisabled_; | 113 this.cellularDisabled_; |
| 115 }; | 114 }; |
| 116 | 115 |
| 117 /** | 116 /** |
| 118 * Shows the notification saying that the drive sync is disabled on cellular | 117 * Shows the notification saying that the drive sync is disabled on cellular |
| 119 * network. | 118 * network. |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 256 |
| 258 /** | 257 /** |
| 259 * Handles preferences change. | 258 * Handles preferences change. |
| 260 * @private | 259 * @private |
| 261 */ | 260 */ |
| 262 DriveSyncHandler.prototype.onPreferencesChanged_ = function() { | 261 DriveSyncHandler.prototype.onPreferencesChanged_ = function() { |
| 263 chrome.fileManagerPrivate.getPreferences(function(pref) { | 262 chrome.fileManagerPrivate.getPreferences(function(pref) { |
| 264 this.cellularDisabled_ = pref.cellularDisabled; | 263 this.cellularDisabled_ = pref.cellularDisabled; |
| 265 }.bind(this)); | 264 }.bind(this)); |
| 266 }; | 265 }; |
| OLD | NEW |