| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 // Callback for the "recordAppLaunchByURL" message. Takes an escaped URL and a | 109 // Callback for the "recordAppLaunchByURL" message. Takes an escaped URL and a |
| 110 // launch source (integer), and if the URL represents an app, records the | 110 // launch source (integer), and if the URL represents an app, records the |
| 111 // action for UMA. | 111 // action for UMA. |
| 112 void HandleRecordAppLaunchByURL(const base::ListValue* args); | 112 void HandleRecordAppLaunchByURL(const base::ListValue* args); |
| 113 | 113 |
| 114 // Register app launcher preferences. | 114 // Register app launcher preferences. |
| 115 static void RegisterUserPrefs(PrefService* pref_service); | 115 static void RegisterUserPrefs(PrefService* pref_service); |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 struct AppInstallInfo { |
| 119 bool is_bookmark_app; |
| 120 string16 title; |
| 121 GURL app_url; |
| 122 int page_index; |
| 123 }; |
| 124 |
| 118 // Records a web store launch in the appropriate histograms. |promo_active| | 125 // Records a web store launch in the appropriate histograms. |promo_active| |
| 119 // specifies if the web store promotion was active. | 126 // specifies if the web store promotion was active. |
| 120 static void RecordWebStoreLaunch(bool promo_active); | 127 static void RecordWebStoreLaunch(bool promo_active); |
| 121 | 128 |
| 122 // Records an app launch in the corresponding |bucket| of the app launch | 129 // Records an app launch in the corresponding |bucket| of the app launch |
| 123 // histogram. |promo_active| specifies if the web store promotion was active. | 130 // histogram. |promo_active| specifies if the web store promotion was active. |
| 124 static void RecordAppLaunchByID(bool promo_active, | 131 static void RecordAppLaunchByID(bool promo_active, |
| 125 extension_misc::AppLaunchBucket bucket); | 132 extension_misc::AppLaunchBucket bucket); |
| 126 | 133 |
| 127 // Records an app launch in the corresponding |bucket| of the app launch | 134 // Records an app launch in the corresponding |bucket| of the app launch |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 std::string extension_id_prompting_; | 184 std::string extension_id_prompting_; |
| 178 | 185 |
| 179 // Whether the promo is currently being shown. | 186 // Whether the promo is currently being shown. |
| 180 bool promo_active_; | 187 bool promo_active_; |
| 181 | 188 |
| 182 // When true, we ignore changes to the underlying data rather than immediately | 189 // When true, we ignore changes to the underlying data rather than immediately |
| 183 // refreshing. This is useful when making many batch updates to avoid flicker. | 190 // refreshing. This is useful when making many batch updates to avoid flicker. |
| 184 bool ignore_changes_; | 191 bool ignore_changes_; |
| 185 | 192 |
| 186 // Hold state for favicon requests. | 193 // Hold state for favicon requests. |
| 187 CancelableRequestConsumerTSimple<WebApplicationInfo*> favicon_consumer_; | 194 CancelableRequestConsumerTSimple<AppInstallInfo*> favicon_consumer_; |
| 188 | 195 |
| 189 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); | 196 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); |
| 190 }; | 197 }; |
| 191 | 198 |
| 192 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ | 199 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ |
| OLD | NEW |