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

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

Issue 2670963002: Android: Fire the appinstalled event on WebAPK installation. (Closed)
Patch Set: Respond to review. Created 3 years, 8 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 | « no previous file | chrome/browser/android/webapps/add_to_homescreen_manager.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.cc
diff --git a/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc b/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
index c0b69b8270aa85d7f07b074489deaec14d67ba4f..7b7ec20717dc9eed65417dd09ef164b52277dd4d 100644
--- a/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
+++ b/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
@@ -352,13 +352,17 @@ bool AppBannerInfoBarDelegateAndroid::TriggeredFromBanner() const {
}
void AppBannerInfoBarDelegateAndroid::SendBannerAccepted() {
- if (weak_manager_ && TriggeredFromBanner()) {
+ if (!weak_manager_)
+ return;
+
+ if (TriggeredFromBanner())
weak_manager_->SendBannerAccepted(event_request_id_);
- // TODO(mgiuca): Send the appinstalled event for WebAPKs (but just removing
- // this check won't be sufficient).
- if (!is_webapk_)
- weak_manager_->OnInstall();
- }
+
+ // Send the appinstalled event. Note that this is fired *before* the
+ // installation actually takes place (which can be a significant amount of
+ // time later, especially if using WebAPKs).
+ // TODO(mgiuca): Fire the event *after* the installation is completed.
+ weak_manager_->OnInstall();
}
void AppBannerInfoBarDelegateAndroid::OnWebApkInstallFinished(
« no previous file with comments | « no previous file | chrome/browser/android/webapps/add_to_homescreen_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698