Spec: https://www.w3.org/TR/appmanifest/#oninstall-attribute
This essentially involves notifying the website that it has been installed by the user.
It isn't clear whether this needs a separate Blink intent-to-implement or whether it fits into the existing mandate for implementing Web App Manifest.
The add to homescreen dialog helper should have a WebContents available via data_fetcher_->web_contents(), which gives you the appropriate renderer. The app banner system does something very similar to this for the beforeinstallprompt event, which calls from the browser process to Blink via WebContents::GetMainFrame::Send, fires off a Javascript event, and waits for a response back before proceeding.
As an aside, you'll also need to trigger this event from the app banner code. That means you probably want to fire it in shortcut_helper.cc, since both add to homescreen and app banners call into there.
I'm thinking of porting the app banner IPCs to Mojo in the near future. This new event should probably use Mojo from the start. It may be worth doing the app banner port first before implementing this event.
OK I'll do the app banner as a Mojo service (since I know how to do that already). Let's not block on porting the app banner IPCs but we can use the oninstall service as a template for doing that later. Thanks for the tips.
Notes from Dom:
AddToHomescreenDataFetcher::FetchSplashScreenImageCallback -- this is called back *after* the app is installed and is therefore the correct time to deliver the oninstall event. Rename or rework around this and send message to its web_contents().
Comment 1 by mgiuca@chromium.org
, Jun 20 2016