Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Side by Side Diff: ui/app_list/app_list_model.h

Issue 907833002: Hide experimental app list Google logo and custom launcher page when search engine is not Google. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_app_list_bg_color
Patch Set: address comment, add service dependency Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/app_list/start_page_service_factory.cc ('k') | ui/app_list/app_list_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/start_page_service_factory.cc ('k') | ui/app_list/app_list_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698