Commit 04051136 authored by mtomasz's avatar mtomasz Committed by Commit bot

Display the icon in the top bar for FSP volumes.

This patch adds the icon to the top bar, so it's the same as in the left nav.

TEST=Tested manually with a FSP based extension.
BUG=None

Review URL: https://codereview.chromium.org/698433002

Cr-Commit-Position: refs/heads/master@{#302242}
parent 9b69a24b
...@@ -330,7 +330,7 @@ div.splitter { ...@@ -330,7 +330,7 @@ div.splitter {
.dialog-header .volume-icon { .dialog-header .volume-icon {
-webkit-margin-start: 10px; -webkit-margin-start: 10px;
background-position: center 3px; background-position: center center;
background-repeat: no-repeat; background-repeat: no-repeat;
flex: none; flex: none;
height: 24px; height: 24px;
......
...@@ -47,17 +47,29 @@ LocationLine.prototype.show = function(entry) { ...@@ -47,17 +47,29 @@ LocationLine.prototype.show = function(entry) {
this.entry_ = entry; this.entry_ = entry;
this.showSequence_++; 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. // Updates volume icon.
var location = this.volumeManager_.getLocationInfo(entry); var locationInfo = this.volumeManager_.getLocationInfo(entry);
if (location && location.rootType && location.isRootEntry) { 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( this.volumeIcon_.setAttribute(
'volume-type-icon', location.rootType); 'volume-type-icon', locationInfo.rootType);
this.volumeIcon_.removeAttribute('volume-subtype');
} else { } else {
this.volumeIcon_.setAttribute( this.volumeIcon_.setAttribute(
'volume-type-icon', location.volumeInfo.volumeType); 'volume-type-icon', locationInfo.volumeInfo.volumeType);
this.volumeIcon_.setAttribute( this.volumeIcon_.setAttribute(
'volume-subtype', location.volumeInfo.deviceType || ''); 'volume-subtype', locationInfo.volumeInfo.deviceType || '');
} }
var queue = new AsyncUtil.Queue(); var queue = new AsyncUtil.Queue();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment