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 3d2fcc66a51c8804807f0408965075b1363d3ddd..2c43cb37079755cc71b7302909f7a8119382af28 100644 |
--- a/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc |
+++ b/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc |
@@ -178,17 +178,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 |