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 3091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3102 var listItem = this.findListItemForEvent_(event); | 3102 var listItem = this.findListItemForEvent_(event); |
3103 sm.setIndexSelected(listItem.listIndex, event.target.checked); | 3103 sm.setIndexSelected(listItem.listIndex, event.target.checked); |
3104 }; | 3104 }; |
3105 | 3105 |
3106 FileManager.prototype.onPinClick_ = function(checkbox, entry, event) { | 3106 FileManager.prototype.onPinClick_ = function(checkbox, entry, event) { |
3107 // TODO(dgozman): revisit this method when gdata properties updated event | 3107 // TODO(dgozman): revisit this method when gdata properties updated event |
3108 // will be available. | 3108 // will be available. |
3109 var self = this; | 3109 var self = this; |
3110 var pin = checkbox.checked; | 3110 var pin = checkbox.checked; |
3111 function callback(props) { | 3111 function callback(props) { |
3112 if (props.errorCode && pin) { | 3112 var fileProps = props[0]; |
3113 if (fileProps.errorCode && pin) { | |
3113 self.metadataCache_.get(entry, 'filesystem', function(filesystem) { | 3114 self.metadataCache_.get(entry, 'filesystem', function(filesystem) { |
Dmitry Zvorygin
2012/04/28 10:58:24
Maybe not this changeset issue, but if the only er
Vladislav Kaznacheev
2012/04/28 11:12:40
As far as I know it is. We can always revisit it l
| |
3114 self.alert.showHtml(str('GDATA_OUT_OF_SPACE_HEADER'), | 3115 self.alert.showHtml(str('GDATA_OUT_OF_SPACE_HEADER'), |
3115 strf('GDATA_OUT_OF_SPACE_MESSAGE', | 3116 strf('GDATA_OUT_OF_SPACE_MESSAGE', |
3116 util.bytesToSi(filesystem.size))); | 3117 util.bytesToSi(filesystem.size))); |
3117 }); | 3118 }); |
3118 } | 3119 } |
3119 // We don't have update events yet, so clear the cached data. | 3120 // We don't have update events yet, so clear the cached data. |
3120 self.metadataCache_.clear(entry, 'gdata'); | 3121 self.metadataCache_.clear(entry, 'gdata'); |
3121 checkbox.checked = props[0].isPinned; | 3122 checkbox.checked = fileProps.isPinned; |
3122 } | 3123 } |
3123 chrome.fileBrowserPrivate.pinGDataFile([entry.toURL()], pin, callback); | 3124 chrome.fileBrowserPrivate.pinGDataFile([entry.toURL()], pin, callback); |
3124 event.preventDefault(); | 3125 event.preventDefault(); |
3125 }; | 3126 }; |
3126 | 3127 |
3127 FileManager.prototype.selectDefaultPathInFilenameInput_ = function() { | 3128 FileManager.prototype.selectDefaultPathInFilenameInput_ = function() { |
3128 var input = this.filenameInput_; | 3129 var input = this.filenameInput_; |
3129 input.focus(); | 3130 input.focus(); |
3130 var selectionEnd = input.value.lastIndexOf('.'); | 3131 var selectionEnd = input.value.lastIndexOf('.'); |
3131 if (selectionEnd == -1) { | 3132 if (selectionEnd == -1) { |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4366 | 4367 |
4367 this.directoryModel_.addEventListener('scan-completed', maybeShowBanner); | 4368 this.directoryModel_.addEventListener('scan-completed', maybeShowBanner); |
4368 this.directoryModel_.addEventListener('rescan-completed', maybeShowBanner); | 4369 this.directoryModel_.addEventListener('rescan-completed', maybeShowBanner); |
4369 | 4370 |
4370 var style = this.document_.createElement('link'); | 4371 var style = this.document_.createElement('link'); |
4371 style.rel = 'stylesheet'; | 4372 style.rel = 'stylesheet'; |
4372 style.href = 'css/gdrive_welcome.css'; | 4373 style.href = 'css/gdrive_welcome.css'; |
4373 this.document_.head.appendChild(style); | 4374 this.document_.head.appendChild(style); |
4374 }; | 4375 }; |
4375 })(); | 4376 })(); |
OLD | NEW |