Index: chrome/browser/ui/app_list/search/webstore/webstore_provider.cc |
diff --git a/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc b/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc |
index 989f13d5ba3a22c85ce85d788374d5e41a8d23b2..dbc9c5db7a8722435f8f76c97577b2317fbd1a6a 100644 |
--- a/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc |
+++ b/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc |
@@ -174,17 +174,18 @@ scoped_ptr<SearchResult> WebstoreProvider::CreateResult( |
extensions::Manifest::Type item_type = ParseItemType(item_type_string); |
// Calculate the relevance score by matching the query with the title. Results |
- // with a match score of 0 are discarded. |
- // TODO(mgiuca): Set the tags to indicate the parts of the title that were |
- // matched. |
+ // with a match score of 0 are discarded. This will also be used to set the |
+ // title tags (highlighting which parts of the title matched the search |
+ // query). |
TokenizedString title(base::UTF8ToUTF16(localized_name)); |
TokenizedStringMatch match; |
if (!match.Calculate(query, title)) |
return scoped_ptr<SearchResult>(); |
- return make_scoped_ptr(new WebstoreResult(profile_, app_id, localized_name, |
- match.relevance(), icon_url, |
- is_paid, item_type, controller_)); |
+ scoped_ptr<SearchResult> result(new WebstoreResult( |
+ profile_, app_id, icon_url, is_paid, item_type, controller_)); |
+ result->UpdateFromMatch(title, match); |
+ return result; |
} |
} // namespace app_list |