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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
886 actions.classList.remove('hide-in-butter'); | 886 actions.classList.remove('hide-in-butter'); |
887 } | 887 } |
888 if ('progress' in opt_options) { | 888 if ('progress' in opt_options) { |
889 butter.querySelector('.progress-bar') | 889 butter.querySelector('.progress-bar') |
890 .classList.remove('hide-in-butter'); | 890 .classList.remove('hide-in-butter'); |
891 } | 891 } |
892 } | 892 } |
893 | 893 |
894 var self = this; | 894 var self = this; |
895 | 895 |
896 setTimeout(function() { | 896 setTimeout(function() { |
Oleg Eterevsky
2012/05/15 09:39:40
Missing the timeout in this call? I don't see wher
SeRya
2012/05/15 10:06:50
opt_options is passed further.
On 2012/05/15 09:3
| |
897 self.currentButter_ = butter; | 897 self.currentButter_ = butter; |
898 self.updateButter(message, opt_options); | 898 self.updateButter(message, opt_options); |
899 self.butterLastShowTime_ = new Date(); | 899 self.butterLastShowTime_ = new Date(); |
900 }); | 900 }); |
901 | 901 |
902 return butter; | 902 return butter; |
903 }; | 903 }; |
904 | 904 |
905 FileManager.prototype.showButterError = function(message, opt_options) { | 905 FileManager.prototype.showButterError = function(message, opt_options) { |
906 var butter = this.showButter(message, opt_options); | 906 var butter = this.showButter(message, opt_options); |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1257 strf('PASTE_FILESYSTEM_ERROR', | 1257 strf('PASTE_FILESYSTEM_ERROR', |
1258 getFileErrorString(event.error.data.code))); | 1258 getFileErrorString(event.error.data.code))); |
1259 } | 1259 } |
1260 break; | 1260 break; |
1261 | 1261 |
1262 default: | 1262 default: |
1263 this.showButterError(strf('PASTE_UNEXPECTED_ERROR', event.error)); | 1263 this.showButterError(strf('PASTE_UNEXPECTED_ERROR', event.error)); |
1264 break; | 1264 break; |
1265 } | 1265 } |
1266 } else if (event.reason == 'CANCELLED') { | 1266 } else if (event.reason == 'CANCELLED') { |
1267 this.showButter(str('PASTE_CANCELLED')); | 1267 this.showButter(str('PASTE_CANCELLED'), { timeout: 1000 }); |
Oleg Eterevsky
2012/05/15 09:39:40
I suspect it should be formatted as follows:
{'ti
SeRya
2012/05/15 10:06:50
Quotas are not needed: http://google-styleguide.go
| |
1268 } else { | 1268 } else { |
1269 console.log('Unknown event reason: ' + event.reason); | 1269 console.log('Unknown event reason: ' + event.reason); |
1270 } | 1270 } |
1271 | 1271 |
1272 // TODO(benchan): Currently, there is no FileWatcher emulation for | 1272 // TODO(benchan): Currently, there is no FileWatcher emulation for |
1273 // GDataFileSystem, so we need to manually trigger the directory rescan | 1273 // GDataFileSystem, so we need to manually trigger the directory rescan |
1274 // after paste operations complete. Remove this once we emulate file | 1274 // after paste operations complete. Remove this once we emulate file |
1275 // watching functionalities in GDataFileSystem. | 1275 // watching functionalities in GDataFileSystem. |
1276 if (this.isOnGData()) { | 1276 if (this.isOnGData()) { |
1277 if (event.reason == 'SUCCESS' || event.reason == 'ERROR' || | 1277 if (event.reason == 'SUCCESS' || event.reason == 'ERROR' || |
(...skipping 3201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4479 | 4479 |
4480 this.directoryModel_.addEventListener('scan-completed', maybeShowBanner); | 4480 this.directoryModel_.addEventListener('scan-completed', maybeShowBanner); |
4481 this.directoryModel_.addEventListener('rescan-completed', maybeShowBanner); | 4481 this.directoryModel_.addEventListener('rescan-completed', maybeShowBanner); |
4482 | 4482 |
4483 var style = this.document_.createElement('link'); | 4483 var style = this.document_.createElement('link'); |
4484 style.rel = 'stylesheet'; | 4484 style.rel = 'stylesheet'; |
4485 style.href = 'css/gdrive_welcome.css'; | 4485 style.href = 'css/gdrive_welcome.css'; |
4486 this.document_.head.appendChild(style); | 4486 this.document_.head.appendChild(style); |
4487 }; | 4487 }; |
4488 })(); | 4488 })(); |
OLD | NEW |