| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 DisplayType display_type() const { return display_type_; } | 102 DisplayType display_type() const { return display_type_; } |
| 103 | 103 |
| 104 const Actions& actions() const { | 104 const Actions& actions() const { |
| 105 return actions_; | 105 return actions_; |
| 106 } | 106 } |
| 107 void SetActions(const Actions& sets); | 107 void SetActions(const Actions& sets); |
| 108 | 108 |
| 109 // 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 |
| 111 // selected.) |
| 112 bool voice_result() const { return voice_result_; } |
| 113 |
| 109 bool is_installing() const { return is_installing_; } | 114 bool is_installing() const { return is_installing_; } |
| 110 void SetIsInstalling(bool is_installing); | 115 void SetIsInstalling(bool is_installing); |
| 111 | 116 |
| 112 int percent_downloaded() const { return percent_downloaded_; } | 117 int percent_downloaded() const { return percent_downloaded_; } |
| 113 void SetPercentDownloaded(int percent_downloaded); | 118 void SetPercentDownloaded(int percent_downloaded); |
| 114 | 119 |
| 115 // Returns the dimension at which this result's icon should be displayed. | 120 // Returns the dimension at which this result's icon should be displayed. |
| 116 int GetPreferredIconDimension() const; | 121 int GetPreferredIconDimension() const; |
| 117 | 122 |
| 118 void NotifyItemInstalled(); | 123 void NotifyItemInstalled(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 134 // no menu for the item (e.g. during install). | 139 // no menu for the item (e.g. during install). |
| 135 // Note the returned menu model is owned by this item. | 140 // Note the returned menu model is owned by this item. |
| 136 virtual ui::MenuModel* GetContextMenuModel(); | 141 virtual ui::MenuModel* GetContextMenuModel(); |
| 137 | 142 |
| 138 protected: | 143 protected: |
| 139 void set_id(const std::string& id) { id_ = id; } | 144 void set_id(const std::string& id) { id_ = id; } |
| 140 void set_relevance(double relevance) { relevance_ = relevance; } | 145 void set_relevance(double relevance) { relevance_ = relevance; } |
| 141 void set_display_type(DisplayType display_type) { | 146 void set_display_type(DisplayType display_type) { |
| 142 display_type_ = display_type; | 147 display_type_ = display_type; |
| 143 } | 148 } |
| 149 void set_voice_result(bool voice_result) { voice_result_ = voice_result; } |
| 144 | 150 |
| 145 private: | 151 private: |
| 146 gfx::ImageSkia icon_; | 152 gfx::ImageSkia icon_; |
| 147 | 153 |
| 148 base::string16 title_; | 154 base::string16 title_; |
| 149 Tags title_tags_; | 155 Tags title_tags_; |
| 150 | 156 |
| 151 base::string16 details_; | 157 base::string16 details_; |
| 152 Tags details_tags_; | 158 Tags details_tags_; |
| 153 | 159 |
| 154 std::string id_; | 160 std::string id_; |
| 155 double relevance_; | 161 double relevance_; |
| 156 DisplayType display_type_; | 162 DisplayType display_type_; |
| 157 | 163 |
| 158 Actions actions_; | 164 Actions actions_; |
| 165 bool voice_result_; |
| 159 | 166 |
| 160 bool is_installing_; | 167 bool is_installing_; |
| 161 int percent_downloaded_; | 168 int percent_downloaded_; |
| 162 | 169 |
| 163 ObserverList<SearchResultObserver> observers_; | 170 ObserverList<SearchResultObserver> observers_; |
| 164 | 171 |
| 165 DISALLOW_COPY_AND_ASSIGN(SearchResult); | 172 DISALLOW_COPY_AND_ASSIGN(SearchResult); |
| 166 }; | 173 }; |
| 167 | 174 |
| 168 } // namespace app_list | 175 } // namespace app_list |
| 169 | 176 |
| 170 #endif // UI_APP_LIST_SEARCH_RESULT_H_ | 177 #endif // UI_APP_LIST_SEARCH_RESULT_H_ |
| OLD | NEW |