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

Unified Diff: chrome/browser/banners/app_banner_manager.h

Issue 2379923002: Implement "appinstalled" event on Android. (Closed)
Patch Set: Minor refactor. Created 4 years, 2 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
Index: chrome/browser/banners/app_banner_manager.h
diff --git a/chrome/browser/banners/app_banner_manager.h b/chrome/browser/banners/app_banner_manager.h
index 19fd112a6306fe571c3f4ae740a979694dbdb5bc..706fd998d5036c04e6760608794cb4ec1987986e 100644
--- a/chrome/browser/banners/app_banner_manager.h
+++ b/chrome/browser/banners/app_banner_manager.h
@@ -16,6 +16,7 @@
#include "chrome/browser/installable/installable_manager.h"
#include "content/public/browser/web_contents_observer.h"
#include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerPromptReply.h"
+#include "third_party/WebKit/public/platform/modules/installation/installation.mojom.h"
class SkBitmap;
struct WebApplicationInfo;
@@ -71,6 +72,11 @@ class AppBannerManager : public content::WebContentsObserver,
// pipeline will be reported to the devtools console.
virtual void RequestAppBanner(const GURL& validated_url, bool is_debug_mode);
+ // Informs the page that it has been installed via an app banner.
+ // This is redundant for the beforeinstallprompt event's promise being
+ // resolved, but is required by the install event spec.
+ void OnInstall();
+
// Overridden and passed through base::Bind on desktop platforms. Called when
// the bookmark app install initiated by a banner has completed. Not used on
// Android.
@@ -262,6 +268,9 @@ class AppBannerManager : public content::WebContentsObserver,
// Whether the installable status has been logged for this run.
bool need_to_log_status_;
+ // Service to send events to the renderer.
+ blink::mojom::InstallationServicePtr installation_service_;
+
// The concrete subclasses of this class are expected to have their lifetimes
// scoped to the WebContents which they are observing. This allows us to use
// weak pointers for callbacks.

Powered by Google App Engine
This is Rietveld 408576698