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

Unified Diff: ui/app_list/search_result.h

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
« no previous file with comments | « chrome/browser/ui/app_list/search/webstore/webstore_result.cc ('k') | ui/app_list/search_result.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/search_result.h
diff --git a/ui/app_list/search_result.h b/ui/app_list/search_result.h
index 4d5300ca486b89bd21861034a07ab16135c3e4df..a7580d022fe8a6b646d2c41d6d04defe5aa036cd 100644
--- a/ui/app_list/search_result.h
+++ b/ui/app_list/search_result.h
@@ -22,6 +22,8 @@ class MenuModel;
namespace app_list {
class SearchResultObserver;
+class TokenizedString;
+class TokenizedStringMatch;
// SearchResult consists of an icon, title text and details text. Title and
// details text can have tagged ranges that are displayed differently from
@@ -135,6 +137,11 @@ class APP_LIST_EXPORT SearchResult {
void AddObserver(SearchResultObserver* observer);
void RemoveObserver(SearchResultObserver* observer);
+ // Updates the result's relevance score, and sets its title and title tags,
+ // based on a string match result.
+ void UpdateFromMatch(const TokenizedString& title,
+ const TokenizedStringMatch& match);
+
// TODO(mukai): Remove this method and really simplify the ownership of
// SearchResult. Ideally, SearchResult will be copyable.
virtual scoped_ptr<SearchResult> Duplicate() const = 0;
@@ -150,6 +157,10 @@ class APP_LIST_EXPORT SearchResult {
// Note the returned menu model is owned by this item.
virtual ui::MenuModel* GetContextMenuModel();
+ // Returns a string showing |text| marked up with brackets indicating the
+ // tag positions in |tags|. Useful for debugging and testing.
+ static std::string TagsDebugString(const std::string& text, const Tags& tags);
+
protected:
void set_id(const std::string& id) { id_ = id; }
void set_voice_result(bool voice_result) { voice_result_ = voice_result; }
« no previous file with comments | « chrome/browser/ui/app_list/search/webstore/webstore_result.cc ('k') | ui/app_list/search_result.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698