OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/extensions/extension_app_api.h" | 10 #include "chrome/browser/extensions/extension_app_api.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // needed. | 156 // needed. |
157 ExtensionInstallUI* GetExtensionInstallUI(); | 157 ExtensionInstallUI* GetExtensionInstallUI(); |
158 | 158 |
159 // Helper that uninstalls all the default apps. | 159 // Helper that uninstalls all the default apps. |
160 void UninstallDefaultApps(); | 160 void UninstallDefaultApps(); |
161 | 161 |
162 // Continuation for installing a bookmark app after favicon lookup. | 162 // Continuation for installing a bookmark app after favicon lookup. |
163 void OnFaviconForApp(FaviconService::Handle handle, | 163 void OnFaviconForApp(FaviconService::Handle handle, |
164 history::FaviconData data); | 164 history::FaviconData data); |
165 | 165 |
| 166 // Sends |highlight_app_id_| to the js. |
| 167 void SetAppToBeHighlighted(); |
| 168 |
166 // The apps are represented in the extensions model, which | 169 // The apps are represented in the extensions model, which |
167 // outlives us since it's owned by our containing profile. | 170 // outlives us since it's owned by our containing profile. |
168 ExtensionService* const extension_service_; | 171 ExtensionService* const extension_service_; |
169 | 172 |
170 // We monitor changes to the extension system so that we can reload the apps | 173 // We monitor changes to the extension system so that we can reload the apps |
171 // when necessary. | 174 // when necessary. |
172 NotificationRegistrar registrar_; | 175 NotificationRegistrar registrar_; |
173 | 176 |
174 // Monitor extension preference changes so that the Web UI can be notified. | 177 // Monitor extension preference changes so that the Web UI can be notified. |
175 PrefChangeRegistrar pref_change_registrar_; | 178 PrefChangeRegistrar pref_change_registrar_; |
(...skipping 11 matching lines...) Expand all Loading... |
187 bool promo_active_; | 190 bool promo_active_; |
188 | 191 |
189 // When true, we ignore changes to the underlying data rather than immediately | 192 // When true, we ignore changes to the underlying data rather than immediately |
190 // refreshing. This is useful when making many batch updates to avoid flicker. | 193 // refreshing. This is useful when making many batch updates to avoid flicker. |
191 bool ignore_changes_; | 194 bool ignore_changes_; |
192 | 195 |
193 // When true, we have attempted to install a bookmark app, and are still | 196 // When true, we have attempted to install a bookmark app, and are still |
194 // waiting to hear about success or failure from the extensions system. | 197 // waiting to hear about success or failure from the extensions system. |
195 bool attempted_bookmark_app_install_; | 198 bool attempted_bookmark_app_install_; |
196 | 199 |
| 200 // True if we have executed HandleGetApps() at least once. |
| 201 bool has_loaded_apps_; |
| 202 |
| 203 // The ID of the app to be highlighted on the NTP (i.e. shown on the page |
| 204 // and pulsed). This is done for new installs. The actual higlighting occurs |
| 205 // when the app is added to the page (via getAppsCallback or appAdded). |
| 206 std::string highlight_app_id_; |
| 207 |
197 // Hold state for favicon requests. | 208 // Hold state for favicon requests. |
198 CancelableRequestConsumerTSimple<AppInstallInfo*> favicon_consumer_; | 209 CancelableRequestConsumerTSimple<AppInstallInfo*> favicon_consumer_; |
199 | 210 |
200 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); | 211 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); |
201 }; | 212 }; |
202 | 213 |
203 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ | 214 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ |
OLD | NEW |