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

Unified Diff: ui/file_manager/file_manager/background/js/launcher_search.js

Issue 1141563002: Show file type icons in launcher search results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | ui/file_manager/file_manager_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/background/js/launcher_search.js
diff --git a/ui/file_manager/file_manager/background/js/launcher_search.js b/ui/file_manager/file_manager/background/js/launcher_search.js
index 96ad5c6205c88202243598f049b5f7f024604264..d64fe25f00fdc8a8bbe549347a9a179cda0b3e8c 100644
--- a/ui/file_manager/file_manager/background/js/launcher_search.js
+++ b/ui/file_manager/file_manager/background/js/launcher_search.js
@@ -118,11 +118,18 @@ LauncherSearch.prototype.onQueryStarted_ = function(queryId, query, limit) {
chrome.launcherSearchProvider.setSearchResults(
queryId,
results.map(function(result) {
- // TODO(yawano): Set custome icon to a result when the API becomes
- // to support it.
+ // Use high-dpi icons since preferred icon size is 24px in the
+ // current implementation.
+ //
+ // TODO(yawano): Use filetype_folder_shared.png for a shared
+ // folder.
+ var iconUrl = chrome.runtime.getURL(
+ 'foreground/images/filetype/2x/filetype_' +
+ FileType.getIcon(result.entry) + '.png');
return {
itemId: result.entry.toURL(),
title: result.entry.name,
+ iconUrl: iconUrl,
// Relevance is set as 2 for all results as a temporary
// implementation. 2 is the middle value.
// TODO(yawano): Implement practical relevance calculation.
« no previous file with comments | « no previous file | ui/file_manager/file_manager_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698