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 <string> | 9 #include <string> |
10 | 10 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 struct AppInstallInfo { | 116 struct AppInstallInfo { |
117 AppInstallInfo(); | 117 AppInstallInfo(); |
118 ~AppInstallInfo(); | 118 ~AppInstallInfo(); |
119 | 119 |
120 bool is_bookmark_app; | 120 bool is_bookmark_app; |
121 string16 title; | 121 string16 title; |
122 GURL app_url; | 122 GURL app_url; |
123 StringOrdinal page_ordinal; | 123 StringOrdinal page_ordinal; |
124 }; | 124 }; |
125 | 125 |
| 126 // Reset some instance flags we use to track the currently uninstalling app. |
| 127 void CleanupAfterUninstall(); |
| 128 |
126 // Records a web store launch in the appropriate histograms. |promo_active| | 129 // Records a web store launch in the appropriate histograms. |promo_active| |
127 // specifies if the web store promotion was active. | 130 // specifies if the web store promotion was active. |
128 static void RecordWebStoreLaunch(bool promo_active); | 131 static void RecordWebStoreLaunch(bool promo_active); |
129 | 132 |
130 // Records an app launch in the corresponding |bucket| of the app launch | 133 // Records an app launch in the corresponding |bucket| of the app launch |
131 // histogram. |promo_active| specifies if the web store promotion was active. | 134 // histogram. |promo_active| specifies if the web store promotion was active. |
132 static void RecordAppLaunchByID(extension_misc::AppLaunchBucket bucket); | 135 static void RecordAppLaunchByID(extension_misc::AppLaunchBucket bucket); |
133 | 136 |
134 // Records an app launch in the corresponding |bucket| of the app launch | 137 // Records an app launch in the corresponding |bucket| of the app launch |
135 // histogram if the |escaped_url| corresponds to an installed app. | 138 // histogram if the |escaped_url| corresponds to an installed app. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 bool attempted_bookmark_app_install_; | 198 bool attempted_bookmark_app_install_; |
196 | 199 |
197 // True if we have executed HandleGetApps() at least once. | 200 // True if we have executed HandleGetApps() at least once. |
198 bool has_loaded_apps_; | 201 bool has_loaded_apps_; |
199 | 202 |
200 // The ID of the app to be highlighted on the NTP (i.e. shown on the page | 203 // The ID of the app to be highlighted on the NTP (i.e. shown on the page |
201 // and pulsed). This is done for new installs. The actual higlighting occurs | 204 // and pulsed). This is done for new installs. The actual higlighting occurs |
202 // when the app is added to the page (via getAppsCallback or appAdded). | 205 // when the app is added to the page (via getAppsCallback or appAdded). |
203 std::string highlight_app_id_; | 206 std::string highlight_app_id_; |
204 | 207 |
| 208 // Used to determine if the current instance of AppLauncherHandler called |
| 209 // ExtensionUninstallAccepted(). If the current one was the one that called |
| 210 // this, we use this value to animate the removal on the attached NTP. |
| 211 bool uninstall_from_page_; |
| 212 |
205 // Hold state for favicon requests. | 213 // Hold state for favicon requests. |
206 CancelableRequestConsumerTSimple<AppInstallInfo*> favicon_consumer_; | 214 CancelableRequestConsumerTSimple<AppInstallInfo*> favicon_consumer_; |
207 | 215 |
208 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); | 216 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); |
209 }; | 217 }; |
210 | 218 |
211 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ | 219 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ |
OLD | NEW |