Chromium Code Reviews| 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 c24ce08f5133ea430e4b2f778406c0f40655587b..6c89d7dcc3946d534400f4b2daafeb0a8d482d69 100644 |
| --- a/ui/file_manager/file_manager/background/js/device_handler.js |
| +++ b/ui/file_manager/file_manager/background/js/device_handler.js |
| @@ -350,6 +350,12 @@ DeviceHandler.prototype.onMountCompleted_ = function(event) { |
| } |
| } |
| } |
| + else if (event.status === 'error_unknown_filesystem') { |
|
hirono
2014/08/22 06:59:24
else should be put at #352 after '}'.
iseki
2014/08/25 04:49:25
Done.
|
| + // The volume id is necessary to navigate when users click start |
| + // format button. |
| + this.navigationVolumes_[event.volumeMetadata.devicePath] = |
| + event.volumeMetadata.volumeId; |
| + } |
| if (event.eventType === 'unmount') { |
| this.navigationVolumes_[volume.devicePath] = null; |
| @@ -406,6 +412,12 @@ DeviceHandler.prototype.onMountCompleted_ = function(event) { |
| if (event.eventType === 'unmount') |
| return; |
| + // If DEVICE_UNKNOWN_MESSAGE error was occurred previously, buttonLabel has |
| + // DEVICE_UNKNOWN_BUTTON_LABEL. However this label is not used for other |
| + // error. |
| + if (DeviceHandler.Notification.DEVICE_FAIL.buttonLabel) { |
|
hirono
2014/08/22 06:59:24
Could you add new notification type (Notification.
iseki
2014/08/25 04:49:25
Done.
|
| + DeviceHandler.Notification.DEVICE_FAIL.buttonLabel = null; |
| + } |
| // Show the notification for the current errors. |
| // If there is no error, do not show/update the notification. |
| var message; |
| @@ -425,6 +437,8 @@ DeviceHandler.prototype.onMountCompleted_ = function(event) { |
| message = volume.deviceLabel ? |
| strf('DEVICE_UNKNOWN_MESSAGE', volume.deviceLabel) : |
| str('DEVICE_UNKNOWN_DEFAULT_MESSAGE'); |
| + DeviceHandler.Notification.DEVICE_FAIL.buttonLabel = |
| + 'DEVICE_UNKNOWN_BUTTON_LABEL' |
|
hirono
2014/08/22 06:59:24
The depth of indent should be 4 when wrapping a li
iseki
2014/08/25 04:49:25
Done.
|
| } |
| break; |
| } |
| @@ -440,13 +454,21 @@ DeviceHandler.prototype.onMountCompleted_ = function(event) { |
| * @private |
| */ |
| DeviceHandler.prototype.onNotificationButtonClicked_ = function(id) { |
| - var match = /^deviceNavigation:(.*)$/.exec(id); |
| - if (match) { |
| - chrome.notifications.clear(id, function() {}); |
| - var event = new Event(DeviceHandler.VOLUME_NAVIGATION_REQUESTED); |
| - event.volumeId = this.navigationVolumes_[match[1]]; |
| - this.dispatchEvent(event); |
| + var pos = id.indexOf(':'); |
| + var type = id.substr(0, pos); |
| + var path = id.substr(pos+1); |
| + chrome.notifications.clear(id, function() {}); |
| + var event; |
| + switch (type) { |
| + case 'deviceNavigation': |
| + case 'deviceFail': |
| + event = new Event(DeviceHandler.VOLUME_NAVIGATION_REQUESTED); |
| + break; |
| + default: |
| + return; |
| } |
| + event.volumeId = this.navigationVolumes_[path]; |
|
hirono
2014/08/22 06:59:24
Could you follow #470 and #471 after #465?
Current
iseki
2014/08/25 04:49:25
Done.
|
| + this.dispatchEvent(event); |
| }; |
| DeviceHandler.prototype.onStartup_ = function() { |