diff options
author | calamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-12 15:20:14 +0000 |
---|---|---|
committer | calamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-12 15:21:29 +0000 |
commit | 070d0b43dd7c2b5ed145ad1b8b2b00246be23221 (patch) | |
tree | 5a04e28ca10df02df3ee3cac7d31a3e1f94394e4 /ui/app_list | |
parent | 9b770aef7f564353654f3eec70e599ece6692955 (diff) | |
download | chromium_src-070d0b43dd7c2b5ed145ad1b8b2b00246be23221.zip chromium_src-070d0b43dd7c2b5ed145ad1b8b2b00246be23221.tar.gz chromium_src-070d0b43dd7c2b5ed145ad1b8b2b00246be23221.tar.bz2 |
Add DisplayType to app list SearchResults
This CL adds a DisplayType property to app list SearchResult properties
which will be used to determine where the results should be displayed
in the experimental app list.
BUG=349727
Review URL: https://codereview.chromium.org/455323003
Cr-Commit-Position: refs/heads/master@{#288976}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288976 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/app_list')
-rw-r--r-- | ui/app_list/search_result.cc | 5 | ||||
-rw-r--r-- | ui/app_list/search_result.h | 11 |
2 files changed, 15 insertions, 1 deletions
diff --git a/ui/app_list/search_result.cc b/ui/app_list/search_result.cc index 9df0e6c..771251f 100644 --- a/ui/app_list/search_result.cc +++ b/ui/app_list/search_result.cc @@ -25,7 +25,10 @@ SearchResult::Action::Action(const base::string16& label_text, SearchResult::Action::~Action() {} SearchResult::SearchResult() - : relevance_(0), is_installing_(false), percent_downloaded_(0) { + : relevance_(0), + display_type_(DISPLAY_LIST), + is_installing_(false), + percent_downloaded_(0) { } SearchResult::~SearchResult() {} diff --git a/ui/app_list/search_result.h b/ui/app_list/search_result.h index d533b793..f210248 100644 --- a/ui/app_list/search_result.h +++ b/ui/app_list/search_result.h @@ -27,6 +27,12 @@ class SearchResultObserver; // default style. class APP_LIST_EXPORT SearchResult { public: + // How the result should be displayed. + enum DisplayType { + DISPLAY_LIST, + DISPLAY_TILE, + }; + // A tagged range in search result text. struct APP_LIST_EXPORT Tag { // Similar to ACMatchClassification::Style, the style values are not @@ -90,6 +96,7 @@ class APP_LIST_EXPORT SearchResult { const std::string& id() const { return id_; } double relevance() const { return relevance_; } + DisplayType display_type() const { return display_type_; } const Actions& actions() const { return actions_; @@ -122,6 +129,9 @@ class APP_LIST_EXPORT SearchResult { protected: void set_id(const std::string& id) { id_ = id; } void set_relevance(double relevance) { relevance_ = relevance; } + void set_display_type(DisplayType display_type) { + display_type_ = display_type; + } private: gfx::ImageSkia icon_; @@ -134,6 +144,7 @@ class APP_LIST_EXPORT SearchResult { std::string id_; double relevance_; + DisplayType display_type_; Actions actions_; |