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

Unified Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 12208084: Removed a context menu from Files.app's left nav, since it became redundant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 10 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
Index: chrome/browser/resources/file_manager/js/file_manager.js
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index 6d242813abd0674fb6db9afcfae1a62c8093ab14..01f6835e7a1771eebf7ea489d137bef48578b59d 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -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);

Powered by Google App Engine
This is Rietveld 408576698