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

Unified Diff: ui/app_list/search_result.h

Issue 2949413002: Show separator in SearchResultTileItemListView (Closed)
Patch Set: Created 3 years, 6 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: ui/app_list/search_result.h
diff --git a/ui/app_list/search_result.h b/ui/app_list/search_result.h
index c88751dccd11d9981e7cc67b5841a1c54e8594bd..c4483115315a044fe6564cd416e209864732e306 100644
--- a/ui/app_list/search_result.h
+++ b/ui/app_list/search_result.h
@@ -49,6 +49,17 @@ class APP_LIST_EXPORT SearchResult {
DISPLAY_TYPE_LAST,
};
+ // Type of the search result. This should be set in corresponding subclass's
+ // constructor.
+ enum ResultType {
+ RESULT_UNKNOWN, // Unknown type.
+ RESULT_INSTALLED_APP, // Installed apps.
+ RESULT_PLAYSTORE_APP, // Uninstalled apps from playstore.
+ RESULT_INSTANT_APP, // Instant apps.
+ RESULT_CONTACT, // Contacts.
xiyuan 2017/06/23 15:43:08 People search is removed. There is no RESULT_CONTA
weidongg 2017/06/23 18:32:20 Done.
+ // Add new values here.
+ };
+
// A tagged range in search result text.
struct APP_LIST_EXPORT Tag {
// Similar to ACMatchClassification::Style, the style values are not
@@ -135,6 +146,9 @@ class APP_LIST_EXPORT SearchResult {
display_type_ = display_type;
}
+ ResultType result_type() const { return result_type_; }
+ void set_result_type(ResultType result_type) { result_type_ = result_type; }
+
int distance_from_origin() { return distance_from_origin_; }
void set_distance_from_origin(int distance) {
distance_from_origin_ = distance;
@@ -223,6 +237,8 @@ class APP_LIST_EXPORT SearchResult {
double relevance_ = 0;
DisplayType display_type_ = DISPLAY_LIST;
+ ResultType result_type_ = RESULT_UNKNOWN;
+
// The Manhattan distance from the origin of all search results to this
// result. This is logged for UMA.
int distance_from_origin_ = -1;

Powered by Google App Engine
This is Rietveld 408576698