OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_APP_LIST_SEARCH_RESULT_H_ | 5 #ifndef UI_APP_LIST_SEARCH_RESULT_H_ |
6 #define UI_APP_LIST_SEARCH_RESULT_H_ | 6 #define UI_APP_LIST_SEARCH_RESULT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 void set_title_tags(const Tags& tags) { title_tags_ = tags; } | 92 void set_title_tags(const Tags& tags) { title_tags_ = tags; } |
93 | 93 |
94 const base::string16& details() const { return details_; } | 94 const base::string16& details() const { return details_; } |
95 void set_details(const base::string16& details) { details_ = details; } | 95 void set_details(const base::string16& details) { details_ = details; } |
96 | 96 |
97 const Tags& details_tags() const { return details_tags_; } | 97 const Tags& details_tags() const { return details_tags_; } |
98 void set_details_tags(const Tags& tags) { details_tags_ = tags; } | 98 void set_details_tags(const Tags& tags) { details_tags_ = tags; } |
99 | 99 |
100 const std::string& id() const { return id_; } | 100 const std::string& id() const { return id_; } |
101 double relevance() const { return relevance_; } | 101 double relevance() const { return relevance_; } |
| 102 |
102 DisplayType display_type() const { return display_type_; } | 103 DisplayType display_type() const { return display_type_; } |
| 104 void set_display_type(DisplayType display_type) { |
| 105 display_type_ = display_type; |
| 106 } |
103 | 107 |
104 const Actions& actions() const { | 108 const Actions& actions() const { |
105 return actions_; | 109 return actions_; |
106 } | 110 } |
107 void SetActions(const Actions& sets); | 111 void SetActions(const Actions& sets); |
108 | 112 |
109 // Whether the result can be automatically selected by a voice query. | 113 // Whether the result can be automatically selected by a voice query. |
110 // (Non-voice results can still appear in the results list to be manually | 114 // (Non-voice results can still appear in the results list to be manually |
111 // selected.) | 115 // selected.) |
112 bool voice_result() const { return voice_result_; } | 116 bool voice_result() const { return voice_result_; } |
(...skipping 23 matching lines...) Expand all Loading... |
136 virtual void InvokeAction(int action_index, int event_flags); | 140 virtual void InvokeAction(int action_index, int event_flags); |
137 | 141 |
138 // Returns the context menu model for this item, or NULL if there is currently | 142 // Returns the context menu model for this item, or NULL if there is currently |
139 // no menu for the item (e.g. during install). | 143 // no menu for the item (e.g. during install). |
140 // Note the returned menu model is owned by this item. | 144 // Note the returned menu model is owned by this item. |
141 virtual ui::MenuModel* GetContextMenuModel(); | 145 virtual ui::MenuModel* GetContextMenuModel(); |
142 | 146 |
143 protected: | 147 protected: |
144 void set_id(const std::string& id) { id_ = id; } | 148 void set_id(const std::string& id) { id_ = id; } |
145 void set_relevance(double relevance) { relevance_ = relevance; } | 149 void set_relevance(double relevance) { relevance_ = relevance; } |
146 void set_display_type(DisplayType display_type) { | |
147 display_type_ = display_type; | |
148 } | |
149 void set_voice_result(bool voice_result) { voice_result_ = voice_result; } | 150 void set_voice_result(bool voice_result) { voice_result_ = voice_result; } |
150 | 151 |
151 private: | 152 private: |
152 gfx::ImageSkia icon_; | 153 gfx::ImageSkia icon_; |
153 | 154 |
154 base::string16 title_; | 155 base::string16 title_; |
155 Tags title_tags_; | 156 Tags title_tags_; |
156 | 157 |
157 base::string16 details_; | 158 base::string16 details_; |
158 Tags details_tags_; | 159 Tags details_tags_; |
159 | 160 |
160 std::string id_; | 161 std::string id_; |
161 double relevance_; | 162 double relevance_; |
162 DisplayType display_type_; | 163 DisplayType display_type_; |
163 | 164 |
164 Actions actions_; | 165 Actions actions_; |
165 bool voice_result_; | 166 bool voice_result_; |
166 | 167 |
167 bool is_installing_; | 168 bool is_installing_; |
168 int percent_downloaded_; | 169 int percent_downloaded_; |
169 | 170 |
170 ObserverList<SearchResultObserver> observers_; | 171 ObserverList<SearchResultObserver> observers_; |
171 | 172 |
172 DISALLOW_COPY_AND_ASSIGN(SearchResult); | 173 DISALLOW_COPY_AND_ASSIGN(SearchResult); |
173 }; | 174 }; |
174 | 175 |
175 } // namespace app_list | 176 } // namespace app_list |
176 | 177 |
177 #endif // UI_APP_LIST_SEARCH_RESULT_H_ | 178 #endif // UI_APP_LIST_SEARCH_RESULT_H_ |
OLD | NEW |