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 40af6b5d348307d46c2cc2d30bb45d86549d2239..e36b4a8ec8588b84be992568a863254f020d7e11 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/service_manager/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)); |
+ |
+ // 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() { |