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

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

Issue 10790100: [File Manager] Support HiDPI images in action picker and default action picker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 5 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_tasks.js
diff --git a/chrome/browser/resources/file_manager/js/file_tasks.js b/chrome/browser/resources/file_manager/js/file_tasks.js
index 45e78f114e2053b1b4dac5e25bd7173e7e9c6bd7..de452921e921a0b1b917f280f21fb8ef5fcf245b 100644
--- a/chrome/browser/resources/file_manager/js/file_tasks.js
+++ b/chrome/browser/resources/file_manager/js/file_tasks.js
@@ -52,12 +52,6 @@ FileTasks.prototype.processTasks_ = function(tasks) {
this.tasks_ = [];
var id = this.fileManager_.getExtensionId();
- // TODO(kaznacheev): Teach menu items to use HiDPI assets.
- function getFileTypeIcon(type) {
- return chrome.extension.getURL(
- 'images/files/file_types/' + type + '.png');
- }
-
for (var i = 0; i < tasks.length; i++) {
var task = tasks[i];
@@ -67,34 +61,34 @@ FileTasks.prototype.processTasks_ = function(tasks) {
if (task_parts[1] == 'play') {
// TODO(serya): This hack needed until task.iconUrl is working
// (see GetFileTasksFileBrowserFunction::RunImpl).
- task.iconUrl = getFileTypeIcon('audio');
+ task.iconType = 'audio';
task.title = loadTimeData.getString('ACTION_LISTEN');
} else if (task_parts[1] == 'mount-archive') {
- task.iconUrl = getFileTypeIcon('archive');
+ task.iconType = 'archive';
task.title = loadTimeData.getString('MOUNT_ARCHIVE');
} else if (task_parts[1] == 'gallery') {
- task.iconUrl = getFileTypeIcon('image');
+ task.iconType = 'image';
task.title = loadTimeData.getString('ACTION_OPEN');
} else if (task_parts[1] == 'watch') {
- task.iconUrl = getFileTypeIcon('video');
+ task.iconType = 'video';
task.title = loadTimeData.getString('ACTION_WATCH');
} else if (task_parts[1] == 'open-hosted') {
if (this.urls_.length > 1)
- task.iconUrl = getFileTypeIcon('generic');
+ task.iconType = 'generic';
else // Use specific icon.
- task.iconUrl = getFileTypeIcon(FileType.getIcon(this.urls_[0]));
+ task.iconType = FileType.getIcon(this.urls_[0]);
task.title = loadTimeData.getString('ACTION_OPEN');
} else if (task_parts[1] == 'view-pdf') {
// Do not render this task if disabled.
if (!loadTimeData.getBoolean('PDF_VIEW_ENABLED'))
continue;
- task.iconUrl = getFileTypeIcon('pdf');
+ task.iconType = 'pdf';
task.title = loadTimeData.getString('ACTION_VIEW');
} else if (task_parts[1] == 'view-in-browser') {
- task.iconUrl = getFileTypeIcon('generic');
+ task.iconType = 'generic';
task.title = loadTimeData.getString('ACTION_VIEW');
} else if (task_parts[1] == 'install-crx') {
- task.iconUrl = getFileTypeIcon('generic');
+ task.iconType = 'generic';
task.title = loadTimeData.getString('INSTALL_CRX');
}
}
@@ -475,7 +469,12 @@ FileTasks.prototype.getExternals_ = function(callback) {
* @private
*/
FileTasks.prototype.createCombobuttonItem_ = function(task, opt_title) {
- return { label: opt_title || task.title, iconUrl: task.iconUrl, task: task };
+ return {
+ label: opt_title || task.title,
+ iconUrl: task.iconUrl,
+ iconType: task.iconType,
+ task: task
+ };
};

Powered by Google App Engine
This is Rietveld 408576698