| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 const Tags& title_tags() const { return title_tags_; } | 91 const Tags& title_tags() const { return title_tags_; } |
| 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 |
| 101 double relevance() const { return relevance_; } | 102 double relevance() const { return relevance_; } |
| 103 void set_relevance(double relevance) { relevance_ = relevance; } |
| 102 | 104 |
| 103 DisplayType display_type() const { return display_type_; } | 105 DisplayType display_type() const { return display_type_; } |
| 104 void set_display_type(DisplayType display_type) { | 106 void set_display_type(DisplayType display_type) { |
| 105 display_type_ = display_type; | 107 display_type_ = display_type; |
| 106 } | 108 } |
| 107 | 109 |
| 108 const Actions& actions() const { | 110 const Actions& actions() const { |
| 109 return actions_; | 111 return actions_; |
| 110 } | 112 } |
| 111 void SetActions(const Actions& sets); | 113 void SetActions(const Actions& sets); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 139 // Invokes a custom action on the result. It does nothing by default. | 141 // Invokes a custom action on the result. It does nothing by default. |
| 140 virtual void InvokeAction(int action_index, int event_flags); | 142 virtual void InvokeAction(int action_index, int event_flags); |
| 141 | 143 |
| 142 // Returns the context menu model for this item, or NULL if there is currently | 144 // Returns the context menu model for this item, or NULL if there is currently |
| 143 // no menu for the item (e.g. during install). | 145 // no menu for the item (e.g. during install). |
| 144 // Note the returned menu model is owned by this item. | 146 // Note the returned menu model is owned by this item. |
| 145 virtual ui::MenuModel* GetContextMenuModel(); | 147 virtual ui::MenuModel* GetContextMenuModel(); |
| 146 | 148 |
| 147 protected: | 149 protected: |
| 148 void set_id(const std::string& id) { id_ = id; } | 150 void set_id(const std::string& id) { id_ = id; } |
| 149 void set_relevance(double relevance) { relevance_ = relevance; } | |
| 150 void set_voice_result(bool voice_result) { voice_result_ = voice_result; } | 151 void set_voice_result(bool voice_result) { voice_result_ = voice_result; } |
| 151 | 152 |
| 152 private: | 153 private: |
| 153 gfx::ImageSkia icon_; | 154 gfx::ImageSkia icon_; |
| 154 | 155 |
| 155 base::string16 title_; | 156 base::string16 title_; |
| 156 Tags title_tags_; | 157 Tags title_tags_; |
| 157 | 158 |
| 158 base::string16 details_; | 159 base::string16 details_; |
| 159 Tags details_tags_; | 160 Tags details_tags_; |
| 160 | 161 |
| 161 std::string id_; | 162 std::string id_; |
| 162 double relevance_; | 163 double relevance_; |
| 163 DisplayType display_type_; | 164 DisplayType display_type_; |
| 164 | 165 |
| 165 Actions actions_; | 166 Actions actions_; |
| 166 bool voice_result_; | 167 bool voice_result_; |
| 167 | 168 |
| 168 bool is_installing_; | 169 bool is_installing_; |
| 169 int percent_downloaded_; | 170 int percent_downloaded_; |
| 170 | 171 |
| 171 ObserverList<SearchResultObserver> observers_; | 172 ObserverList<SearchResultObserver> observers_; |
| 172 | 173 |
| 173 DISALLOW_COPY_AND_ASSIGN(SearchResult); | 174 DISALLOW_COPY_AND_ASSIGN(SearchResult); |
| 174 }; | 175 }; |
| 175 | 176 |
| 176 } // namespace app_list | 177 } // namespace app_list |
| 177 | 178 |
| 178 #endif // UI_APP_LIST_SEARCH_RESULT_H_ | 179 #endif // UI_APP_LIST_SEARCH_RESULT_H_ |
| OLD | NEW |