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

Unified Diff: ui/file_manager/file_manager/background/js/device_handler.js

Issue 651403002: Fix trivial type-check errors in file_manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and correct a comment. Created 6 years, 2 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/background/js/device_handler.js
diff --git a/ui/file_manager/file_manager/background/js/device_handler.js b/ui/file_manager/file_manager/background/js/device_handler.js
index bf79b40c4fb6918d3a92c5b10f0c1c496c7af246..ede54098f505c1ab065868d0e40aedc21991e81a 100644
--- a/ui/file_manager/file_manager/background/js/device_handler.js
+++ b/ui/file_manager/file_manager/background/js/device_handler.js
@@ -192,7 +192,7 @@ DeviceHandler.Notification.prototype.showOnce = function(devicePath) {
/**
* Shows the notificaiton without using AsyncQueue.
- * @param {string} notificaitonId Notification ID.
+ * @param {string} notificationId Notification ID.
* @param {?string} message Message overriding the normal message.
* @param {function()} callback Callback to be invoked when the notification is
* created.
@@ -302,14 +302,13 @@ DeviceHandler.prototype.onMountCompleted_ = function(event) {
// If this is remounting, which happens when resuming ChromeOS, the device has
// already inserted to the computer. So we suppress the notification.
var volume = event.volumeMetadata;
- if (!volume.deviceType || !event.shouldNotify)
+ if (!volume.deviceType || !volume.devicePath || !event.shouldNotify)
return;
// If the current volume status is succeed and it should be handled in
// Files.app, show the notification to navigate the volume.
if (event.eventType === 'mount' && event.status === 'success') {
- DeviceHandler.Notification.DEVICE_NAVIGATION.show(
- event.volumeMetadata.devicePath);
+ DeviceHandler.Notification.DEVICE_NAVIGATION.show(volume.devicePath);
} else if (event.eventType === 'unmount') {
DeviceHandler.Notification.DEVICE_NAVIGATION.hide(volume.devicePath);
}

Powered by Google App Engine
This is Rietveld 408576698