| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 // Returns the dimension at which this result's icon should be displayed. | 112 // Returns the dimension at which this result's icon should be displayed. |
| 113 int GetPreferredIconDimension() const; | 113 int GetPreferredIconDimension() const; |
| 114 | 114 |
| 115 void NotifyItemInstalled(); | 115 void NotifyItemInstalled(); |
| 116 void NotifyItemUninstalled(); | 116 void NotifyItemUninstalled(); |
| 117 | 117 |
| 118 void AddObserver(SearchResultObserver* observer); | 118 void AddObserver(SearchResultObserver* observer); |
| 119 void RemoveObserver(SearchResultObserver* observer); | 119 void RemoveObserver(SearchResultObserver* observer); |
| 120 | 120 |
| 121 // TODO(mukai): Remove this method and really simplify the ownership of |
| 122 // SearchResult. Ideally, SearchResult will be copyable. |
| 123 virtual scoped_ptr<SearchResult> Duplicate() = 0; |
| 124 |
| 121 // Opens the result. | 125 // Opens the result. |
| 122 virtual void Open(int event_flags); | 126 virtual void Open(int event_flags); |
| 123 | 127 |
| 124 // Invokes a custom action on the result. | 128 // Invokes a custom action on the result. It does nothing by default. |
| 125 virtual void InvokeAction(int action_index, int event_flags); | 129 virtual void InvokeAction(int action_index, int event_flags); |
| 126 | 130 |
| 127 // Returns the context menu model for this item, or NULL if there is currently | 131 // Returns the context menu model for this item, or NULL if there is currently |
| 128 // no menu for the item (e.g. during install). | 132 // no menu for the item (e.g. during install). |
| 129 // Note the returned menu model is owned by this item. | 133 // Note the returned menu model is owned by this item. |
| 130 virtual ui::MenuModel* GetContextMenuModel(); | 134 virtual ui::MenuModel* GetContextMenuModel(); |
| 131 | 135 |
| 132 protected: | 136 protected: |
| 133 void set_id(const std::string& id) { id_ = id; } | 137 void set_id(const std::string& id) { id_ = id; } |
| 134 void set_relevance(double relevance) { relevance_ = relevance; } | 138 void set_relevance(double relevance) { relevance_ = relevance; } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 155 int percent_downloaded_; | 159 int percent_downloaded_; |
| 156 | 160 |
| 157 ObserverList<SearchResultObserver> observers_; | 161 ObserverList<SearchResultObserver> observers_; |
| 158 | 162 |
| 159 DISALLOW_COPY_AND_ASSIGN(SearchResult); | 163 DISALLOW_COPY_AND_ASSIGN(SearchResult); |
| 160 }; | 164 }; |
| 161 | 165 |
| 162 } // namespace app_list | 166 } // namespace app_list |
| 163 | 167 |
| 164 #endif // UI_APP_LIST_SEARCH_RESULT_H_ | 168 #endif // UI_APP_LIST_SEARCH_RESULT_H_ |
| OLD | NEW |