Add "Create shortcut..." back to "More tools" when PWA installation is enabled
This CL brings back "Create shortcut..." to the app menu's "More tools" section
even on installable PWA sites where we would originally omit it in favour
of showing "Install <app name>...".
Now we always show "Create shortcut..." and optionally show
"Install <app name>..." if the site is an installable PWA.
This splits the IDC_CREATE_HOSTED_APP command in two; IDC_CREATE_SHORTCUT
and IDC_INSTALL_PWA and plumbs a bool through to BookmarkAppHelper to
distinguish which type of install the user requested.
Bug: 887824
Change-Id: I432670327588f6639f374289664b3add4a6b7b81
Reviewed-on: https://chromium-review.googlesource.com/1226481
Reviewed-by: Ben Wells <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Reviewed-by: Michael Wasserman <[email protected]>
Reviewed-by: Finnur Thorarinsson <[email protected]>
Reviewed-by: Giovanni Ortuño Urquidi <[email protected]>
Reviewed-by: Dominick Ng <[email protected]>
Commit-Queue: Alan Cutter <[email protected]>
Cr-Commit-Position: refs/heads/master@{#593767}
diff --git a/chrome/browser/extensions/tab_helper.h b/chrome/browser/extensions/tab_helper.h
index 9dd5aee..8fa70a9 100644
--- a/chrome/browser/extensions/tab_helper.h
+++ b/chrome/browser/extensions/tab_helper.h
@@ -54,7 +54,7 @@
public:
~TabHelper() override;
- void CreateHostedAppFromWebContents();
+ void CreateHostedAppFromWebContents(bool shortcut_app_requested);
bool CanCreateBookmarkApp() const;
// ScriptExecutionObserver::Delegate
@@ -158,6 +158,7 @@
// Message handlers.
void OnDidGetWebApplicationInfo(
chrome::mojom::ChromeRenderFrameAssociatedPtr chrome_render_frame,
+ bool shortcut_app_requested,
const WebApplicationInfo& info);
void OnGetAppInstallState(content::RenderFrameHost* host,
const GURL& requestor_url,
@@ -191,7 +192,7 @@
// Requests application info for the specified page. This is an asynchronous
// request. The delegate is notified by way of OnDidGetWebApplicationInfo when
// the data is available.
- void GetApplicationInfo(WebAppAction action);
+ void GetApplicationInfo(WebAppAction action, bool shortcut_app_requested);
// Sends our tab ID to |render_frame_host|.
void SetTabId(content::RenderFrameHost* render_frame_host);