Index: ui/app_list/search_result.h |
diff --git a/ui/app_list/search_result.h b/ui/app_list/search_result.h |
index 7e7524fafc2472cf50c83a50a88db069ebc9696c..a0ab43767d538b77cd55889f5f3c387698f54a45 100644 |
--- a/ui/app_list/search_result.h |
+++ b/ui/app_list/search_result.h |
@@ -22,6 +22,22 @@ namespace app_list { |
class SearchResultObserver; |
+// The type of the search result. This is used for logging so do not change the |
+// order of this enum. |
+enum SearchResultType { |
xiyuan
2014/10/02 20:47:08
This is chrome specific and probably should not li
Jun Mukai
2014/10/03 01:24:23
Thinking about this, I think it's better not to do
tapted
2014/10/03 02:59:17
looks nice :)
|
+ // A result that forwards an omnibox search result. |
+ OMNIBOX_SEARCH_RESULT, |
+ // An app result. |
+ APP_SEARCH_RESULT, |
+ // A search result from the webstore. |
+ WEBSTORE_SEARCH_RESULT, |
+ // A result that opens a webstore search. |
+ SEARCH_WEBSTORE_SEARCH_RESULT, |
+ // A result that opens a people search. |
+ SEARCH_PEOPLE_SEARCH_RESULT, |
+ SEARCH_RESULT_TYPE_BOUNDARY |
+}; |
+ |
// SearchResult consists of an icon, title text and details text. Title and |
// details text can have tagged ranges that are displayed differently from |
// default style. |
@@ -118,10 +134,19 @@ class APP_LIST_EXPORT SearchResult { |
void AddObserver(SearchResultObserver* observer); |
void RemoveObserver(SearchResultObserver* observer); |
+ // TODO(mukai): Remove this method and really simplify the ownership of |
+ // SearchResult. Ideally, SearchResult will be copyable. |
+ virtual scoped_ptr<SearchResult> Duplicate(); |
tapted
2014/10/02 07:19:21
Can these be pure virtual? I think I'd prefer the
Jun Mukai
2014/10/03 01:24:23
Done.
|
+ |
+ // Returns the type of the search for logging. By default it returns |
+ // SEARCH_RESULT_TYPE_BOUNDARY which is okay for tests but will cause problems |
+ // in production. |
+ virtual SearchResultType GetType(); |
+ |
// Opens the result. |
virtual void Open(int event_flags); |
- // Invokes a custom action on the result. |
+ // Invokes a custom action on the result. It does nothing by default. |
virtual void InvokeAction(int action_index, int event_flags); |
// Returns the context menu model for this item, or NULL if there is currently |