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

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

Issue 2319603002: Hide "Format device" button in notification of unknown device when it is read only. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | ui/file_manager/file_manager/background/js/device_handler_unittest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a1e96019db0fc72dffffc7d238f18f73847a4ad2..78fd1b76acc6e180730a956255f3b7c5291273b4 100644
--- a/ui/file_manager/file_manager/background/js/device_handler.js
+++ b/ui/file_manager/file_manager/background/js/device_handler.js
@@ -121,6 +121,16 @@ DeviceHandler.Notification.DEVICE_FAIL_UNKNOWN = new DeviceHandler.Notification(
* @type {DeviceHandler.Notification}
* @const
*/
+DeviceHandler.Notification.DEVICE_FAIL_UNKNOWN_READONLY =
+ new DeviceHandler.Notification(
+ 'deviceFail',
+ 'REMOVABLE_DEVICE_DETECTION_TITLE',
+ 'DEVICE_UNKNOWN_DEFAULT_MESSAGE');
+
+/**
+ * @type {DeviceHandler.Notification}
+ * @const
+ */
DeviceHandler.Notification.DEVICE_EXTERNAL_STORAGE_DISABLED =
new DeviceHandler.Notification(
'deviceFail',
@@ -391,9 +401,15 @@ DeviceHandler.prototype.onMountCompleted_ = function(event) {
message = volume.deviceLabel ?
strf('DEVICE_UNKNOWN_MESSAGE', volume.deviceLabel) :
str('DEVICE_UNKNOWN_DEFAULT_MESSAGE');
- DeviceHandler.Notification.DEVICE_FAIL_UNKNOWN.show(
- /** @type {string} */ (volume.devicePath),
- message);
+ if (event.volumeMetadata.isReadOnly) {
+ DeviceHandler.Notification.DEVICE_FAIL_UNKNOWN_READONLY.show(
+ /** @type {string} */ (volume.devicePath),
+ message);
+ } else {
+ DeviceHandler.Notification.DEVICE_FAIL_UNKNOWN.show(
+ /** @type {string} */ (volume.devicePath),
+ message);
+ }
}
}
};
« no previous file with comments | « no previous file | ui/file_manager/file_manager/background/js/device_handler_unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698