Commit f9c17575 authored by mtomasz@chromium.org's avatar mtomasz@chromium.org

Removed a context menu from Files.app's left nav, since it became redundant.

This menu became redundant after moving the remaining space indicator to the gear button menu.

TEST=Check if Files.app is not broken. Context menu should be also gone.
BUG=174622

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181858 0039d316-1c4b-4281-b951-d872f2087c98
parent ce4595d2
......@@ -1563,19 +1563,20 @@ body:not([drive]) [required_drive] {
min-width: 250px;
}
#volume-space-info,
#downloads-space-info {
#volume-space-info {
-webkit-box-pack: justify;
display: -webkit-box;
}
#volume-space-info-label,
#downloads-space-info-label {
#volume-space-info-label {
display: block;
}
#volume-space-info > div,
#downloads-space-info > div {
#volume-space-info-label {
display: block;
}
#volume-space-info > div {
-webkit-box-flex: 1;
border: 1px solid rgb(192, 192, 192);
display: block;
......@@ -1584,8 +1585,7 @@ body:not([drive]) [required_drive] {
min-width: 30px;
}
#volume-space-info-bar[pending],
#downloads-space-info-bar[pending] {
#volume-space-info-bar[pending] {
-webkit-animation-duration: 800ms;
-webkit-animation-iteration-count: infinite;
-webkit-animation-name: bg;
......@@ -1599,8 +1599,7 @@ body:not([drive]) [required_drive] {
background-size: 16px 8px;
}
#volume-space-info-bar,
#downloads-space-info-bar {
#volume-space-info-bar {
background-color: rgb(192, 192, 192);
border: 1px solid rgb(255, 255, 255);
box-sizing: border-box;
......
......@@ -536,10 +536,6 @@ DialogType.isModal = function(type) {
this.dialogDom_.querySelector('#roots-context-menu');
cr.ui.Menu.decorate(this.rootsContextMenu_);
this.downloadsRootContextMenu_ =
this.dialogDom_.querySelector('#downloads-root-context-menu');
cr.ui.Menu.decorate(this.downloadsRootContextMenu_);
this.textContextMenu_ =
this.dialogDom_.querySelector('#text-context-menu');
cr.ui.Menu.decorate(this.textContextMenu_);
......@@ -607,9 +603,6 @@ DialogType.isModal = function(type) {
CommandUtil.registerCommand(doc, 'drive-go-to-drive',
Commands.driveGoToDriveCommand, this);
CommandUtil.registerCommand(doc, 'files-app-help',
Commands.filesAppHelpCommand, this);
CommandUtil.registerCommand(doc, 'paste',
Commands.pasteFileCommand, doc, this.fileTransferController_);
......@@ -1447,47 +1440,8 @@ DialogType.isModal = function(type) {
li.appendChild(eject);
}
// Add a context menu for the root. "Downloads" has a menu item showing the
// remaining space information.
if (rootType == RootType.DOWNLOADS) {
cr.ui.contextMenuHandler.setContextMenu(li,
this.downloadsRootContextMenu_);
var downloadsRootContextMenu = this.downloadsRootContextMenu_;
var downloadsSpaceInfoLabel =
this.dialogDom_.querySelector('#downloads-space-info-label');
var downloadsSpaceInnerBar =
this.dialogDom_.querySelector('#downloads-space-info-bar');
var downloadsSpaceOuterBar =
this.dialogDom_.querySelector('#downloads-space-info-bar').
parentNode;
if (this.downloadsRootContextMenuListener_) {
cr.ui.contextMenuHandler.removeEventListener(
'show', this.downloadsRootContextMenuListener_);
}
this.downloadsRootContextMenuListener_ = function(ev) {
// Check available space on opening the context menu for Downloads.
if (ev.element != li || ev.menu != downloadsRootContextMenu)
return;
downloadsSpaceInnerBar.setAttribute('pending', '');
spaceInfoLabel.textContent = strf('SPACE_AVAILABLE', sizeStr);
chrome.fileBrowserPrivate.getSizeStats(
util.makeFilesystemUrl(path),
function(sizeStats) {
updateSpaceInfo(sizeStats, downloadsSpaceInnerBar,
downloadsSpaceInfoLabel, downloadsSpaceOuterBar);
});
};
cr.ui.contextMenuHandler.addEventListener(
'show', this.downloadsRootContextMenuListener_);
} else if (rootType != RootType.DRIVE) {
if (rootType != RootType.DRIVE && rootType != RootType.DOWNLOADS)
cr.ui.contextMenuHandler.setContextMenu(li, this.rootsContextMenu_);
}
cr.defineProperty(li, 'lead', cr.PropertyKind.BOOL_ATTR);
cr.defineProperty(li, 'selected', cr.PropertyKind.BOOL_ATTR);
......
......@@ -404,15 +404,3 @@ Commands.zipSelectionCommand = {
selection && selection.totalCount > 0;
}
};
/**
* Opens Files App help.
*/
Commands.filesAppHelpCommand = {
execute: function() {
window.open(FileManager.FILES_APP_HELP, 'help');
},
canExecute: function(event, fileManager) {
event.canExecute = true;
}
};
......@@ -142,9 +142,6 @@
i18n-values="label:OPEN_WITH_BUTTON_LABEL"></command>
<command id="zip-selection"
i18n-values="label:ZIP_SELECTION_BUTTON_LABEL"></command>
<command id="files-app-help" i18n-values="label:HELP_LINK_LABEL">
</command>
</commands>
<menu id="file-context-menu" class="chrome-menu" showShortcuts>
......@@ -170,8 +167,6 @@
<menuitem command="#import-photos"></menuitem>
<menuitem command="#unmount"></menuitem>
<menuitem command="#format"></menuitem>
<hr>
<menuitem command="#files-app-help"></menuitem>
</menu>
<menu id="gear-menu" class="chrome-menu">
......@@ -204,18 +199,6 @@
<menuitem command="#delete"></menuitem>
</menu>
<menu id="downloads-root-context-menu" class="chrome-menu">
<div id="downloads-space-info" disabled>
<span id="downloads-space-info-label"
i18n-content=WAITING_FOR_SPACE_INFO
></span>
<div>
<div id="downloads-space-info-bar" style="width:100%" pending></div>
</div>
</div>
<menuitem command="#files-app-help"></menuitem>
</menu>
<div class=dialog-title invisibleif="full-page">[TITLE]</div>
<div class=dialog-container>
<div class=dialog-sidebar>
......
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