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

Unified Diff: chrome/browser/android/banners/app_banner_infobar_delegate_android.h

Issue 2301263004: Add WebAPK installation metrics. (Closed)
Patch Set: pkotwicz@'s comments. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/android/banners/app_banner_infobar_delegate_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/banners/app_banner_infobar_delegate_android.h
diff --git a/chrome/browser/android/banners/app_banner_infobar_delegate_android.h b/chrome/browser/android/banners/app_banner_infobar_delegate_android.h
index 6e09f1b5ad2a846be7a6aa4ef067bb33bc59dabd..ee90ad6479dc71ec9881b27e593ac61ff9819e82 100644
--- a/chrome/browser/android/banners/app_banner_infobar_delegate_android.h
+++ b/chrome/browser/android/banners/app_banner_infobar_delegate_android.h
@@ -79,6 +79,15 @@ class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate {
bool AcceptWebApk(content::WebContents* web_contents);
private:
+ // The states of a WebAPK installation, where the infobar is displayed during
+ // the entire installation process. This state is used to correctly record
+ // UMA metrics.
+ enum InstallState {
+ INSTALL_NOT_STARTED,
+ INSTALLING,
+ INSTALLED,
+ };
+
// Delegate for promoting a web app.
AppBannerInfoBarDelegateAndroid(
base::WeakPtr<AppBannerManager> weak_manager,
@@ -103,6 +112,7 @@ class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate {
void SendBannerAccepted(content::WebContents* web_contents,
const std::string& platform);
void OnWebApkInstallFinished(bool success, const std::string& webapk_package);
+ void TrackWebApkInstallationDismissEvents(InstallState install_state);
// ConfirmInfoBarDelegate:
infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
@@ -133,6 +143,9 @@ class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate {
std::string webapk_package_name_;
bool is_webapk_;
+ // Indicates the current state of a WebAPK installation.
+ InstallState install_state_;
+
base::WeakPtrFactory<AppBannerInfoBarDelegateAndroid> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid);
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/android/banners/app_banner_infobar_delegate_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698