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

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

Issue 10870098: [FileBrowser] Fixed default action context menu item (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comment. Created 8 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c610e4520e0e4453b96911b242b5ecd4d4bf066b..ccae65877ea6ef5c633a6c2b8a5b3e08ed2b8ad8 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -4183,24 +4183,35 @@ FileManager.prototype = {
str('GDATA_FAILED_SPACE_INFO');
}
}.bind(this));
- }
+ };
/**
* Updates default action menu item to match passed taskItem(icon,
* label and action).
* @param {Object} taskItem - taskItem to match.
*/
- FileManager.prototype.setDefaultActionMenuItem = function(taskItem) {
- if (taskItem) {
- this.defaultActionMenuItem_.iconUrl = taskItem.iconUrl;
- this.defaultActionMenuItem_.label = taskItem.title;
- this.defaultActionMenuItem_.taskId = taskItem.taskId;
+ FileManager.prototype.setDefaultActionMenuItem = function(defaultItem) {
+ if (defaultItem) {
+
+ if (defaultItem.iconType) {
+ this.defaultActionMenuItem_.style.backgroundImage = '';
+ this.defaultActionMenuItem_.setAttribute('file-type-icon',
+ defaultItem.iconType);
+ } else if (defaultItem.iconUrl) {
+ this.defaultActionMenuItem_.style.backgroundImage =
+ 'url(' + defaultItem.iconUrl + ')';
+ } else {
+ this.defaultActionMenuItem_.style.backgroundImage = '';
+ }
+
+ this.defaultActionMenuItem_.label = defaultItem.title;
+ this.defaultActionMenuItem_.taskId = defaultItem.taskId;
}
var defaultActionSeparator =
this.dialogDom_.querySelector('#default-action-separator');
- this.defaultActionMenuItem_.hidden = !taskItem;
- defaultActionSeparator.hidden = !taskItem;
- }
+ this.defaultActionMenuItem_.hidden = !defaultItem;
+ defaultActionSeparator.hidden = !defaultItem;
+ };
})();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698