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

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

Issue 698433002: Display the icon in the top bar for FSP volumes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up. 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
« no previous file with comments | « ui/file_manager/file_manager/foreground/css/file_manager.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/ui/location_line.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/location_line.js b/ui/file_manager/file_manager/foreground/js/ui/location_line.js
index 25fbdcf63193615a1959be78de080a715138bb19..771e7feba148c6e90673bcad9d6daffaa928c70a 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/location_line.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/location_line.js
@@ -47,17 +47,29 @@ LocationLine.prototype.show = function(entry) {
this.entry_ = entry;
this.showSequence_++;
+ // Clear the background image for the icon and the sub type (if any).
+ this.volumeIcon_.removeAttribute('style');
+ this.volumeIcon_.removeAttribute('volume-subtype');
+
// Updates volume icon.
- var location = this.volumeManager_.getLocationInfo(entry);
- if (location && location.rootType && location.isRootEntry) {
+ var locationInfo = this.volumeManager_.getLocationInfo(entry);
+ if (locationInfo && locationInfo.rootType && locationInfo.isRootEntry) {
+ if (locationInfo.volumeInfo.volumeType ===
+ VolumeManagerCommon.VolumeType.PROVIDED) {
+ var extensionId = locationInfo.volumeInfo.extensionId;
+ var backgroundImage = '-webkit-image-set(' +
+ 'url(chrome://extension-icon/' + extensionId + '/16/1) 1x, ' +
+ 'url(chrome://extension-icon/' + extensionId + '/32/1) 2x);';
+ this.volumeIcon_.setAttribute(
+ 'style', 'background-image: ' + backgroundImage);
+ }
this.volumeIcon_.setAttribute(
- 'volume-type-icon', location.rootType);
- this.volumeIcon_.removeAttribute('volume-subtype');
+ 'volume-type-icon', locationInfo.rootType);
} else {
this.volumeIcon_.setAttribute(
- 'volume-type-icon', location.volumeInfo.volumeType);
+ 'volume-type-icon', locationInfo.volumeInfo.volumeType);
this.volumeIcon_.setAttribute(
- 'volume-subtype', location.volumeInfo.deviceType || '');
+ 'volume-subtype', locationInfo.volumeInfo.deviceType || '');
}
var queue = new AsyncUtil.Queue();
« no previous file with comments | « ui/file_manager/file_manager/foreground/css/file_manager.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698