Use the current visible URL for add to homescreen

Desktop / Chromium - Dominick Ng [chromium.org] - 10 August 2017 01:23 EDT

This addresses a bug where invoking add to homescreen prior to navigation commit led to a null icon being generated for the page. This causes either:

a) no shortcut to be added (pre Android O); or b) a crash (Android O+)

The fix replaces the use of the last committed URL with the current
visible URL. This is arguably more correct since all other items in the Chrome menu determine their enabled state based on the visible URL, not the last committed URL.

BUG=747959

Change-Id: If1f431ca29f5948ee6f562e2db773d408218bde7 Reviewed-on: https://chromium-review.googlesource.com/604819 Commit-Queue: Dominick Ng

e915a03 Use the current visible URL for add to homescreen.
.../browser/appmenu/AppMenuPropertiesDelegate.java | 4 ++-
.../CustomTabAppMenuPropertiesDelegate.java | 3 +-
.../browser/webapps/AddToHomescreenManager.java | 13 ++++++--
.../webapps/AddToHomescreenManagerTest.java | 35 +++++++++++-----------
.../webapps/add_to_homescreen_data_fetcher.cc | 14 ++++-----
.../add_to_homescreen_data_fetcher_unittest.cc | 7 +++--
.../android/webapps/add_to_homescreen_manager.cc | 3 ++
7 files changed, 48 insertions(+), 31 deletions(-)

Upstream: git.chromium.org


  • Share