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_APP_LIST_MODEL_H_ | 5 #ifndef UI_APP_LIST_APP_LIST_MODEL_H_ |
6 #define UI_APP_LIST_APP_LIST_MODEL_H_ | 6 #define UI_APP_LIST_APP_LIST_MODEL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 // Call OnExtensionPreferenceChanged() for all items in the model. | 125 // Call OnExtensionPreferenceChanged() for all items in the model. |
126 void NotifyExtensionPreferenceChanged(); | 126 void NotifyExtensionPreferenceChanged(); |
127 | 127 |
128 // Sets whether or not the folder UI should be enabled. If |folders_enabled| | 128 // Sets whether or not the folder UI should be enabled. If |folders_enabled| |
129 // is false, removes any non-OEM folders. | 129 // is false, removes any non-OEM folders. |
130 void SetFoldersEnabled(bool folders_enabled); | 130 void SetFoldersEnabled(bool folders_enabled); |
131 | 131 |
132 // Sets whether or not the custom launcher page should be enabled. | 132 // Sets whether or not the custom launcher page should be enabled. |
133 void SetCustomLauncherPageEnabled(bool enabled); | 133 void SetCustomLauncherPageEnabled(bool enabled); |
134 bool custom_launcher_page_enabled() { return custom_launcher_page_enabled_; } | 134 bool custom_launcher_page_enabled() const { |
| 135 return custom_launcher_page_enabled_; |
| 136 } |
135 | 137 |
136 // Pushes a custom launcher page's subpage into the state stack in the model. | 138 // Pushes a custom launcher page's subpage into the state stack in the model. |
137 void PushCustomLauncherPageSubpage(); | 139 void PushCustomLauncherPageSubpage(); |
138 | 140 |
139 // If the state stack is not empty, pops a subpage from the stack and returns | 141 // If the state stack is not empty, pops a subpage from the stack and returns |
140 // true. Returns false if the stack was empty. | 142 // true. Returns false if the stack was empty. |
141 bool PopCustomLauncherPageSubpage(); | 143 bool PopCustomLauncherPageSubpage(); |
142 | 144 |
143 // Clears the custom launcher page's subpage state stack from the model. | 145 // Clears the custom launcher page's subpage state stack from the model. |
144 void ClearCustomLauncherPageSubpages(); | 146 void ClearCustomLauncherPageSubpages(); |
145 | 147 |
146 int custom_launcher_page_subpage_depth() { | 148 int custom_launcher_page_subpage_depth() { |
147 return custom_launcher_page_subpage_depth_; | 149 return custom_launcher_page_subpage_depth_; |
148 } | 150 } |
149 | 151 |
| 152 void SetSearchEngineIsGoogle(bool is_google); |
| 153 bool search_engine_is_google() const { return search_engine_is_google_; } |
| 154 |
150 // Filters the given |results| by |display_type|. The returned list is | 155 // Filters the given |results| by |display_type|. The returned list is |
151 // truncated to |max_results|. | 156 // truncated to |max_results|. |
152 static std::vector<SearchResult*> FilterSearchResultsByDisplayType( | 157 static std::vector<SearchResult*> FilterSearchResultsByDisplayType( |
153 SearchResults* results, | 158 SearchResults* results, |
154 SearchResult::DisplayType display_type, | 159 SearchResult::DisplayType display_type, |
155 size_t max_results); | 160 size_t max_results); |
156 | 161 |
157 AppListItemList* top_level_item_list() { return top_level_item_list_.get(); } | 162 AppListItemList* top_level_item_list() { return top_level_item_list_.get(); } |
158 | 163 |
159 SearchBoxModel* search_box() { return search_box_.get(); } | 164 SearchBoxModel* search_box() { return search_box_.get(); } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 scoped_ptr<AppListItemList> top_level_item_list_; | 201 scoped_ptr<AppListItemList> top_level_item_list_; |
197 | 202 |
198 scoped_ptr<SearchBoxModel> search_box_; | 203 scoped_ptr<SearchBoxModel> search_box_; |
199 scoped_ptr<SearchResults> results_; | 204 scoped_ptr<SearchResults> results_; |
200 | 205 |
201 Status status_; | 206 Status status_; |
202 State state_; | 207 State state_; |
203 ObserverList<AppListModelObserver, true> observers_; | 208 ObserverList<AppListModelObserver, true> observers_; |
204 bool folders_enabled_; | 209 bool folders_enabled_; |
205 bool custom_launcher_page_enabled_; | 210 bool custom_launcher_page_enabled_; |
| 211 bool search_engine_is_google_; |
206 | 212 |
207 // The current number of subpages the custom launcher page has pushed. | 213 // The current number of subpages the custom launcher page has pushed. |
208 int custom_launcher_page_subpage_depth_; | 214 int custom_launcher_page_subpage_depth_; |
209 | 215 |
210 DISALLOW_COPY_AND_ASSIGN(AppListModel); | 216 DISALLOW_COPY_AND_ASSIGN(AppListModel); |
211 }; | 217 }; |
212 | 218 |
213 } // namespace app_list | 219 } // namespace app_list |
214 | 220 |
215 #endif // UI_APP_LIST_APP_LIST_MODEL_H_ | 221 #endif // UI_APP_LIST_APP_LIST_MODEL_H_ |
OLD | NEW |