Commit d398f548 authored by mgiuca's avatar mgiuca Committed by Commit bot

Fix appinstalled event firing when user opens a WebAPK from banner.

The "Open" button was calling SendBannerAccepted, which made the
assumption that the app was being installed. Removed this call and
documented the method's semantics.

BUG=716313

Review-Url: https://codereview.chromium.org/2848703005
Cr-Commit-Position: refs/heads/master@{#467903}
parent a1336afb
...@@ -303,11 +303,10 @@ bool AppBannerInfoBarDelegateAndroid::AcceptWebApk( ...@@ -303,11 +303,10 @@ bool AppBannerInfoBarDelegateAndroid::AcceptWebApk(
JNIEnv* env = base::android::AttachCurrentThread(); JNIEnv* env = base::android::AttachCurrentThread();
// If the WebAPK is installed and the "Open" button is clicked, open the // If the WebAPK is installed and the "Open" button is clicked, open the
// WebAPK. // WebAPK. Do not send a BannerAccepted message.
if (install_state_ == INSTALLED) { if (install_state_ == INSTALLED) {
Java_AppBannerInfoBarDelegateAndroid_openWebApk(env, java_delegate_); Java_AppBannerInfoBarDelegateAndroid_openWebApk(env, java_delegate_);
webapk::TrackUserAction(webapk::USER_ACTION_INSTALLED_OPEN); webapk::TrackUserAction(webapk::USER_ACTION_INSTALLED_OPEN);
SendBannerAccepted();
return true; return true;
} }
......
...@@ -122,6 +122,10 @@ class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { ...@@ -122,6 +122,10 @@ class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate {
// Returns false if this delegate is for a WebAPK and was triggered from the // Returns false if this delegate is for a WebAPK and was triggered from the
// A2HS menu item. Otherwise returns true. // A2HS menu item. Otherwise returns true.
bool TriggeredFromBanner() const; bool TriggeredFromBanner() const;
// Called when the user accepts the banner to install the app. (Not called
// when the "Open" button is pressed on the banner that is shown after
// installation for WebAPK banners.)
void SendBannerAccepted(); void SendBannerAccepted();
void OnWebApkInstallFinished(WebApkInstallResult result, void OnWebApkInstallFinished(WebApkInstallResult result,
bool relax_updates, bool relax_updates,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment