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

Unified Diff: chrome/browser/ui/app_list/search/app_result.cc

Issue 1110883003: App Launcher: Webstore results are now highlighted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@applist-webstore-result-match
Patch Set: Update tests to test for highlighting. 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
Index: chrome/browser/ui/app_list/search/app_result.cc
diff --git a/chrome/browser/ui/app_list/search/app_result.cc b/chrome/browser/ui/app_list/search/app_result.cc
index 0b1e7121326085b2ca5ca009c167d7a2cbcbcf5e..d8752cb13d6e24c7bc0cf5dde2171909928bcc9a 100644
--- a/chrome/browser/ui/app_list/search/app_result.cc
+++ b/chrome/browser/ui/app_list/search/app_result.cc
@@ -23,8 +23,6 @@
#include "extensions/common/extension_icon_set.h"
#include "extensions/common/manifest_handlers/icons_handler.h"
#include "ui/app_list/app_list_switches.h"
-#include "ui/app_list/search/tokenized_string.h"
-#include "ui/app_list/search/tokenized_string_match.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/image/image_skia_operations.h"
@@ -65,20 +63,6 @@ AppResult::~AppResult() {
StopObservingExtensionRegistry();
}
-void AppResult::UpdateFromMatch(const TokenizedString& title,
- const TokenizedStringMatch& match) {
- const TokenizedStringMatch::Hits& hits = match.hits();
-
- Tags tags;
- tags.reserve(hits.size());
- for (size_t i = 0; i < hits.size(); ++i)
- tags.push_back(Tag(Tag::MATCH, hits[i].start(), hits[i].end()));
-
- set_title(title.text());
- set_title_tags(tags);
- set_relevance(match.relevance());
-}
-
void AppResult::UpdateFromLastLaunched(const base::Time& current_time,
const base::Time& last_launched) {
base::TimeDelta delta = current_time - last_launched;
@@ -129,6 +113,7 @@ scoped_ptr<SearchResult> AppResult::Duplicate() const {
display_type() == DISPLAY_RECOMMENDATION));
copy->set_title(title());
copy->set_title_tags(title_tags());
+ copy->set_relevance(relevance());
return copy.Pass();
}
« no previous file with comments | « chrome/browser/ui/app_list/search/app_result.h ('k') | chrome/browser/ui/app_list/search/webstore/webstore_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698