Commit 8c9c508a authored by Gang Wu's avatar Gang Wu Committed by Chromium LUCI CQ

App menu should handle install_app_id and menu_open_webapk_id


Bug: 1155430
Change-Id: I5e323b8ecfdcdfbbbd9c98f575c864e17ff62d81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2574078Reviewed-by: default avatarFinnur Thorarinsson <finnur@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Gang Wu <gangwu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833798}
parent 72c4a4aa
...@@ -2069,11 +2069,12 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent> ...@@ -2069,11 +2069,12 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
new TabPrinter(currentTab), new PrintManagerDelegateImpl(this)); new TabPrinter(currentTab), new PrintManagerDelegateImpl(this));
RecordUserAction.record("MobileMenuPrint"); RecordUserAction.record("MobileMenuPrint");
} }
} else if (id == R.id.add_to_homescreen_id || id == R.id.add_to_homescreen_menu_id) { } else if (id == R.id.add_to_homescreen_id || id == R.id.add_to_homescreen_menu_id
|| id == R.id.install_app_id) {
AddToHomescreenCoordinator.showForAppMenu(currentTab, this, getWindowAndroid(), AddToHomescreenCoordinator.showForAppMenu(currentTab, this, getWindowAndroid(),
getModalDialogManager(), currentTab.getWebContents(), mMenuItemData); getModalDialogManager(), currentTab.getWebContents(), mMenuItemData);
RecordUserAction.record("MobileMenuAddToHomescreen"); RecordUserAction.record("MobileMenuAddToHomescreen");
} else if (id == R.id.open_webapk_id) { } else if (id == R.id.open_webapk_id || id == R.id.menu_open_webapk_id) {
Context context = ContextUtils.getApplicationContext(); Context context = ContextUtils.getApplicationContext();
String packageName = String packageName =
WebApkValidator.queryFirstWebApkPackage(context, currentTab.getUrlString()); WebApkValidator.queryFirstWebApkPackage(context, currentTab.getUrlString());
......
...@@ -804,7 +804,8 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate ...@@ -804,7 +804,8 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
public Bundle getBundleForMenuItem(MenuItem item) { public Bundle getBundleForMenuItem(MenuItem item) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
if (item.getItemId() == R.id.add_to_homescreen_id if (item.getItemId() == R.id.add_to_homescreen_id
|| item.getItemId() == R.id.add_to_homescreen_menu_id) { || item.getItemId() == R.id.add_to_homescreen_menu_id
|| item.getItemId() == R.id.install_app_id) {
bundle.putInt(AppBannerManager.MENU_TITLE_KEY, mAddAppTitleShown); bundle.putInt(AppBannerManager.MENU_TITLE_KEY, mAddAppTitleShown);
} }
return bundle; return bundle;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment