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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 void AddObserver(SearchResultObserver* observer); | 147 void AddObserver(SearchResultObserver* observer); |
148 void RemoveObserver(SearchResultObserver* observer); | 148 void RemoveObserver(SearchResultObserver* observer); |
149 | 149 |
150 // Updates the result's relevance score, and sets its title and title tags, | 150 // Updates the result's relevance score, and sets its title and title tags, |
151 // based on a string match result. | 151 // based on a string match result. |
152 void UpdateFromMatch(const TokenizedString& title, | 152 void UpdateFromMatch(const TokenizedString& title, |
153 const TokenizedStringMatch& match); | 153 const TokenizedStringMatch& match); |
154 | 154 |
155 // TODO(mukai): Remove this method and really simplify the ownership of | 155 // TODO(mukai): Remove this method and really simplify the ownership of |
156 // SearchResult. Ideally, SearchResult will be copyable. | 156 // SearchResult. Ideally, SearchResult will be copyable. |
157 virtual scoped_ptr<SearchResult> Duplicate() const = 0; | 157 virtual std::unique_ptr<SearchResult> Duplicate() const = 0; |
158 | 158 |
159 // Invokes a custom action on the result. It does nothing by default. | 159 // Invokes a custom action on the result. It does nothing by default. |
160 virtual void InvokeAction(int action_index, int event_flags); | 160 virtual void InvokeAction(int action_index, int event_flags); |
161 | 161 |
162 // Returns the context menu model for this item, or NULL if there is currently | 162 // Returns the context menu model for this item, or NULL if there is currently |
163 // no menu for the item (e.g. during install). | 163 // no menu for the item (e.g. during install). |
164 // Note the returned menu model is owned by this item. | 164 // Note the returned menu model is owned by this item. |
165 virtual ui::MenuModel* GetContextMenuModel(); | 165 virtual ui::MenuModel* GetContextMenuModel(); |
166 | 166 |
167 // Returns a string showing |text| marked up with brackets indicating the | 167 // Returns a string showing |text| marked up with brackets indicating the |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 int percent_downloaded_; | 202 int percent_downloaded_; |
203 | 203 |
204 base::ObserverList<SearchResultObserver> observers_; | 204 base::ObserverList<SearchResultObserver> observers_; |
205 | 205 |
206 DISALLOW_COPY_AND_ASSIGN(SearchResult); | 206 DISALLOW_COPY_AND_ASSIGN(SearchResult); |
207 }; | 207 }; |
208 | 208 |
209 } // namespace app_list | 209 } // namespace app_list |
210 | 210 |
211 #endif // UI_APP_LIST_SEARCH_RESULT_H_ | 211 #endif // UI_APP_LIST_SEARCH_RESULT_H_ |
OLD | NEW |