Chromium Code Reviews| Index: chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc |
| diff --git a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc |
| index 4f81469e28db610ff5cdbe43ea129c46e68967a7..ba22b5dfa53788290809cd60a50c0aa5c604ff75 100644 |
| --- a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc |
| +++ b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc |
| @@ -229,10 +229,10 @@ void AddToHomescreenDataFetcher::OnDidPerformInstallableCheck( |
| shortcut_info_.minimum_splash_image_size_in_px = |
| minimum_splash_image_size_in_px_; |
| + bool webapk_compatible = false; |
| if (check_webapk_compatibility_) { |
| - bool webapk_compatible = |
| - (data.error_code == NO_ERROR_DETECTED && |
| - AreWebManifestUrlsWebApkCompatible(data.manifest)); |
| + webapk_compatible = (data.error_code == NO_ERROR_DETECTED && |
| + AreWebManifestUrlsWebApkCompatible(data.manifest)); |
| weak_observer_->OnDidDetermineWebApkCompatibility(webapk_compatible); |
| if (webapk_compatible) |
| @@ -244,7 +244,12 @@ void AddToHomescreenDataFetcher::OnDidPerformInstallableCheck( |
| if (data.primary_icon) { |
| shortcut_info_.best_primary_icon_url = data.primary_icon_url; |
| - CreateLauncherIcon(*(data.primary_icon)); |
| + if (webapk_compatible) { |
|
dominickn
2017/06/15 03:01:27
The multiple returns here are a bit strange. Can w
|
| + NotifyObserver(*data.primary_icon); |
| + return; |
| + } |
| + |
| + CreateLauncherIcon(*data.primary_icon); |
| return; |
| } |