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

Unified Diff: ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js

Issue 2292873003: Divide volume_manager.js into files for each classes and extract interfaces from them. (Closed)
Patch Set: Address comments. Created 4 years, 3 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
Index: ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js
diff --git a/ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js b/ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js
index c3e80027e7a0cd9d7ba2f85d58cbeba13a6f6a53..bb356d87442f54ca0f92cf6faf58d33bbafd3275 100644
--- a/ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js
+++ b/ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js
@@ -48,10 +48,11 @@ function VolumeManagerWrapper(allowedPaths, opt_backgroundPage) {
}
queue.run(function(callNextStep) {
- this.backgroundPage_.VolumeManager.getInstance(function(volumeManager) {
- this.onReady_(volumeManager);
- callNextStep();
- }.bind(this));
+ this.backgroundPage_.volumeManagerFactory.getInstance(
+ function(volumeManager) {
+ this.onReady_(volumeManager);
+ callNextStep();
+ }.bind(this));
}.bind(this));
}
@@ -159,11 +160,12 @@ VolumeManagerWrapper.prototype.onEvent_ = function(event) {
eventVolumeType = VolumeManagerCommon.VolumeType.DRIVE;
break;
case 'externally-unmounted':
+ event = /** @type {!ExternallyUnmountedEvent} */ (event);
eventVolumeType = event.volumeInfo.volumeType;
break;
}
- if (this.isAllowedVolume_(eventVolumeType))
+ if (eventVolumeType && this.isAllowedVolume_(eventVolumeType))
this.dispatchEvent(event);
};
@@ -377,7 +379,7 @@ VolumeManagerWrapper.prototype.toString = function() {
var initialized = this.isInitialized();
var volumeManager = initialized ?
this.volumeManager_ :
- this.backgroundPage_.VolumeManager.getInstanceForDebug();
+ this.backgroundPage_.volumeManagerFactory.getInstanceForDebug();
var str = 'VolumeManagerWrapper\n' +
'- Initialized: ' + initialized + '\n';

Powered by Google App Engine
This is Rietveld 408576698