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 /** | 5 /** |
6 * FileManager constructor. | 6 * FileManager constructor. |
7 * | 7 * |
8 * FileManager objects encapsulate the functionality of the file selector | 8 * FileManager objects encapsulate the functionality of the file selector |
9 * dialogs, as well as the full screen file manager application (though the | 9 * dialogs, as well as the full screen file manager application (though the |
10 * latter is not yet implemented). | 10 * latter is not yet implemented). |
(...skipping 4128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4139 | 4139 |
4140 /** | 4140 /** |
4141 * Listener invoked on gdata menu show event, to update gdata free/total | 4141 * Listener invoked on gdata menu show event, to update gdata free/total |
4142 * space info in opened menu. | 4142 * space info in opened menu. |
4143 * @private | 4143 * @private |
4144 */ | 4144 */ |
4145 FileManager.prototype.onGDataMenuShow_ = function() { | 4145 FileManager.prototype.onGDataMenuShow_ = function() { |
4146 this.updateCommands_(); | 4146 this.updateCommands_(); |
4147 this.gdataSpaceInfoBar_.setAttribute('pending', ''); | 4147 this.gdataSpaceInfoBar_.setAttribute('pending', ''); |
4148 chrome.fileBrowserPrivate.getSizeStats( | 4148 chrome.fileBrowserPrivate.getSizeStats( |
4149 this.directoryModel_.getCurrentDirEntry().toURL(), function(result) { | 4149 this.directoryModel_.getCurrentRootUrl(), function(result) { |
4150 if (!chrome.extension.lastError) { | 4150 if (!chrome.extension.lastError) { |
4151 this.gdataSpaceInfoBar_.removeAttribute('pending'); | 4151 this.gdataSpaceInfoBar_.removeAttribute('pending'); |
4152 | 4152 |
4153 var sizeInGb = util.bytesToSi(result.remainingSizeKB * 1024); | 4153 var sizeInGb = util.bytesToSi(result.remainingSizeKB * 1024); |
4154 this.gdataSpaceInfoLabel_.textContent = | 4154 this.gdataSpaceInfoLabel_.textContent = |
4155 strf('GDATA_SPACE_AVAILABLE', sizeInGb); | 4155 strf('GDATA_SPACE_AVAILABLE', sizeInGb); |
4156 | 4156 |
4157 var usedSpace = result.totalSizeKB - result.remainingSizeKB; | 4157 var usedSpace = result.totalSizeKB - result.remainingSizeKB; |
4158 | 4158 |
4159 this.gdataSpaceInfoBar_.style.display = ''; | 4159 this.gdataSpaceInfoBar_.style.display = ''; |
(...skipping 20 matching lines...) Expand all Loading... |
4180 } | 4180 } |
4181 | 4181 |
4182 var defaultActionSeparator = | 4182 var defaultActionSeparator = |
4183 this.dialogDom_.querySelector('#default-action-separator'); | 4183 this.dialogDom_.querySelector('#default-action-separator'); |
4184 | 4184 |
4185 this.defaultActionMenuItem_.hidden = !taskItem; | 4185 this.defaultActionMenuItem_.hidden = !taskItem; |
4186 defaultActionSeparator.hidden = !taskItem; | 4186 defaultActionSeparator.hidden = !taskItem; |
4187 } | 4187 } |
4188 })(); | 4188 })(); |
4189 | 4189 |
OLD | NEW |