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 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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "chrome/browser/api/prefs/pref_change_registrar.h" | 11 #include "chrome/browser/api/prefs/pref_change_registrar.h" |
12 #include "chrome/browser/cancelable_request.h" | 12 #include "chrome/browser/cancelable_request.h" |
13 #include "chrome/browser/extensions/extension_install_prompt.h" | 13 #include "chrome/browser/extensions/extension_install_prompt.h" |
14 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 14 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
15 #include "chrome/browser/favicon/favicon_service.h" | 15 #include "chrome/browser/favicon/favicon_service.h" |
16 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
17 #include "chrome/common/extensions/extension_constants.h" | 17 #include "chrome/common/extensions/extension_constants.h" |
18 #include "chrome/common/string_ordinal.h" | |
19 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
20 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
21 #include "content/public/browser/web_ui_message_handler.h" | 20 #include "content/public/browser/web_ui_message_handler.h" |
| 21 #include "sync/api/string_ordinal.h" |
22 | 22 |
23 class ExtensionService; | 23 class ExtensionService; |
24 class PrefChangeRegistrar; | 24 class PrefChangeRegistrar; |
25 class Profile; | 25 class Profile; |
26 | 26 |
27 namespace extensions { | 27 namespace extensions { |
28 class AppNotification; | 28 class AppNotification; |
29 } | 29 } |
30 | 30 |
31 // The handler for Javascript messages related to the "apps" view. | 31 // The handler for Javascript messages related to the "apps" view. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 static void RecordAppLaunchType(extension_misc::AppLaunchBucket bucket); | 108 static void RecordAppLaunchType(extension_misc::AppLaunchBucket bucket); |
109 | 109 |
110 private: | 110 private: |
111 struct AppInstallInfo { | 111 struct AppInstallInfo { |
112 AppInstallInfo(); | 112 AppInstallInfo(); |
113 ~AppInstallInfo(); | 113 ~AppInstallInfo(); |
114 | 114 |
115 bool is_bookmark_app; | 115 bool is_bookmark_app; |
116 string16 title; | 116 string16 title; |
117 GURL app_url; | 117 GURL app_url; |
118 StringOrdinal page_ordinal; | 118 syncer::StringOrdinal page_ordinal; |
119 }; | 119 }; |
120 | 120 |
121 // Reset some instance flags we use to track the currently uninstalling app. | 121 // Reset some instance flags we use to track the currently uninstalling app. |
122 void CleanupAfterUninstall(); | 122 void CleanupAfterUninstall(); |
123 | 123 |
124 // Records a web store launch in the appropriate histograms. | 124 // Records a web store launch in the appropriate histograms. |
125 static void RecordWebStoreLaunch(); | 125 static void RecordWebStoreLaunch(); |
126 | 126 |
127 // Records an app launch in the corresponding |bucket| of the app launch | 127 // Records an app launch in the corresponding |bucket| of the app launch |
128 // histogram. |promo_active| specifies if the web store promotion was active. | 128 // histogram. |promo_active| specifies if the web store promotion was active. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // when the app is added to the page (via getAppsCallback or appAdded). | 199 // when the app is added to the page (via getAppsCallback or appAdded). |
200 std::string highlight_app_id_; | 200 std::string highlight_app_id_; |
201 | 201 |
202 // Hold state for favicon requests. | 202 // Hold state for favicon requests. |
203 CancelableRequestConsumerTSimple<AppInstallInfo*> favicon_consumer_; | 203 CancelableRequestConsumerTSimple<AppInstallInfo*> favicon_consumer_; |
204 | 204 |
205 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); | 205 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); |
206 }; | 206 }; |
207 | 207 |
208 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ | 208 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ |
OLD | NEW |