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

Unified Diff: chrome/browser/android/webapps/add_to_homescreen_manager.cc

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/android/webapps/add_to_homescreen_manager.cc
diff --git a/chrome/browser/android/webapps/add_to_homescreen_manager.cc b/chrome/browser/android/webapps/add_to_homescreen_manager.cc
index 2b972540eb30ee6467c29f8dd6860bf58553c9e7..b74906205386ccadc786095ea20fcd3c3b89def0 100644
--- a/chrome/browser/android/webapps/add_to_homescreen_manager.cc
+++ b/chrome/browser/android/webapps/add_to_homescreen_manager.cc
@@ -17,9 +17,12 @@
#include "chrome/browser/android/webapk/webapk_metrics.h"
#include "chrome/browser/banners/app_banner_settings_helper.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/origin_util.h"
#include "jni/AddToHomescreenManager_jni.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
+#include "services/shell/public/cpp/interface_provider.h"
#include "ui/gfx/android/java_bitmap.h"
using base::android::JavaParamRef;
@@ -115,6 +118,14 @@ void AddToHomescreenManager::AddShortcut(const ShortcutInfo& info,
ShortcutHelper::AddToLauncherWithSkBitmap(
web_contents->GetBrowserContext(), info, uid, icon,
data_fetcher_->FetchSplashScreenImageCallback(uid));
+
dominickn 2016/10/12 22:35:09 This doesn't account for WebAPKs, which call Short
Matt Giuca 2016/12/09 04:36:48 As with Desktop, let's leave WebAPKs for another C
+ // Fire the appinstalled event.
+ if (!installation_service_) {
+ web_contents->GetMainFrame()->GetRemoteInterfaces()->GetInterface(
+ mojo::GetProxy(&installation_service_));
+ DCHECK(installation_service_);
+ }
+ installation_service_->OnInstall();
}
void AddToHomescreenManager::RecordAddToHomescreen() {

Powered by Google App Engine
This is Rietveld 408576698