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

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

Issue 2379923002: Implement "appinstalled" event on Android. (Closed)
Patch Set: Blink style. Created 4 years 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.cc
diff --git a/chrome/browser/banners/app_banner_manager.cc b/chrome/browser/banners/app_banner_manager.cc
index bad00344b52368bea0cd80bbc2e25dece364427c..a971318b9a5f0a2816744b17ff920203bc53729e 100644
--- a/chrome/browser/banners/app_banner_manager.cc
+++ b/chrome/browser/banners/app_banner_manager.cc
@@ -23,6 +23,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/origin_util.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
dominickn 2016/12/09 06:08:17 Is this include necessary? We're already calling G
Matt Giuca 2016/12/12 04:28:19 Done.
#include "services/service_manager/public/cpp/interface_provider.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/display/display.h"
@@ -132,6 +133,15 @@ void AppBannerManager::RequestAppBanner(const GURL& validated_url,
base::Bind(&AppBannerManager::OnDidGetManifest, GetWeakPtr()));
}
+void AppBannerManager::OnInstall() {
+ if (!installation_service_) {
dominickn 2016/12/09 06:08:17 As noted in the header file, just made this a loca
Matt Giuca 2016/12/12 04:28:20 Are there performance issues about calling GetMain
dominickn 2016/12/12 05:03:30 1) this isn't a frequently called method, but addi
Matt Giuca 2016/12/14 03:39:40 Done.
+ web_contents()->GetMainFrame()->GetRemoteInterfaces()->GetInterface(
+ mojo::GetProxy(&installation_service_));
+ DCHECK(installation_service_);
+ }
+ installation_service_->OnInstall();
+}
+
void AppBannerManager::SendBannerAccepted(int request_id) {
if (request_id != gCurrentRequestID)
return;

Powered by Google App Engine
This is Rietveld 408576698