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

Side by Side Diff: ui/app_list/search_result.h

Issue 2949413002: Show separator in SearchResultTileItemListView (Closed)
Patch Set: Created 3 years, 5 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 unified diff | Download patch
OLDNEW
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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 DISPLAY_NONE = 0, 42 DISPLAY_NONE = 0,
43 DISPLAY_LIST, 43 DISPLAY_LIST,
44 DISPLAY_TILE, 44 DISPLAY_TILE,
45 DISPLAY_RECOMMENDATION, 45 DISPLAY_RECOMMENDATION,
46 DISPLAY_CARD, 46 DISPLAY_CARD,
47 // Add new values here. 47 // Add new values here.
48 48
49 DISPLAY_TYPE_LAST, 49 DISPLAY_TYPE_LAST,
50 }; 50 };
51 51
52 // Type of the search result. This should be set in corresponding subclass's
53 // constructor.
54 enum ResultType {
55 RESULT_UNKNOWN, // Unknown type.
56 RESULT_INSTALLED_APP, // Installed apps.
57 RESULT_PLAYSTORE_APP, // Uninstalled apps from playstore.
58 RESULT_INSTANT_APP, // Instant apps.
59 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.
60 // Add new values here.
61 };
62
52 // A tagged range in search result text. 63 // A tagged range in search result text.
53 struct APP_LIST_EXPORT Tag { 64 struct APP_LIST_EXPORT Tag {
54 // Similar to ACMatchClassification::Style, the style values are not 65 // Similar to ACMatchClassification::Style, the style values are not
55 // mutually exclusive. 66 // mutually exclusive.
56 enum Style { 67 enum Style {
57 NONE = 0, 68 NONE = 0,
58 URL = 1 << 0, 69 URL = 1 << 0,
59 MATCH = 1 << 1, 70 MATCH = 1 << 1,
60 DIM = 1 << 2, 71 DIM = 1 << 2,
61 }; 72 };
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 const std::string& id() const { return id_; } 139 const std::string& id() const { return id_; }
129 140
130 double relevance() const { return relevance_; } 141 double relevance() const { return relevance_; }
131 void set_relevance(double relevance) { relevance_ = relevance; } 142 void set_relevance(double relevance) { relevance_ = relevance; }
132 143
133 DisplayType display_type() const { return display_type_; } 144 DisplayType display_type() const { return display_type_; }
134 void set_display_type(DisplayType display_type) { 145 void set_display_type(DisplayType display_type) {
135 display_type_ = display_type; 146 display_type_ = display_type;
136 } 147 }
137 148
149 ResultType result_type() const { return result_type_; }
150 void set_result_type(ResultType result_type) { result_type_ = result_type; }
151
138 int distance_from_origin() { return distance_from_origin_; } 152 int distance_from_origin() { return distance_from_origin_; }
139 void set_distance_from_origin(int distance) { 153 void set_distance_from_origin(int distance) {
140 distance_from_origin_ = distance; 154 distance_from_origin_ = distance;
141 } 155 }
142 156
143 const Actions& actions() const { 157 const Actions& actions() const {
144 return actions_; 158 return actions_;
145 } 159 }
146 void SetActions(const Actions& sets); 160 void SetActions(const Actions& sets);
147 161
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // SearchProvider to set this property and own this view. 230 // SearchProvider to set this property and own this view.
217 views::View* view_ = nullptr; 231 views::View* view_ = nullptr;
218 232
219 // If view_ isn't null, indicates whether the mouse cursor is inside view_. 233 // If view_ isn't null, indicates whether the mouse cursor is inside view_.
220 bool mouse_is_in_view_ = false; 234 bool mouse_is_in_view_ = false;
221 235
222 std::string id_; 236 std::string id_;
223 double relevance_ = 0; 237 double relevance_ = 0;
224 DisplayType display_type_ = DISPLAY_LIST; 238 DisplayType display_type_ = DISPLAY_LIST;
225 239
240 ResultType result_type_ = RESULT_UNKNOWN;
241
226 // The Manhattan distance from the origin of all search results to this 242 // The Manhattan distance from the origin of all search results to this
227 // result. This is logged for UMA. 243 // result. This is logged for UMA.
228 int distance_from_origin_ = -1; 244 int distance_from_origin_ = -1;
229 245
230 Actions actions_; 246 Actions actions_;
231 bool voice_result_ = false; 247 bool voice_result_ = false;
232 248
233 bool is_installing_ = false; 249 bool is_installing_ = false;
234 int percent_downloaded_ = 0; 250 int percent_downloaded_ = 0;
235 251
236 base::ObserverList<SearchResultObserver> observers_; 252 base::ObserverList<SearchResultObserver> observers_;
237 253
238 DISALLOW_COPY_AND_ASSIGN(SearchResult); 254 DISALLOW_COPY_AND_ASSIGN(SearchResult);
239 }; 255 };
240 256
241 } // namespace app_list 257 } // namespace app_list
242 258
243 #endif // UI_APP_LIST_SEARCH_RESULT_H_ 259 #endif // UI_APP_LIST_SEARCH_RESULT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698