Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Unified Diff: chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc

Issue 2937823002: [Android] Make WebApplicationInfo and Web Manifest mutually exclusive (Closed)
Patch Set: Merge branch 'master' into reenable_tests000 Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 e5f3bc8762e6a643138a6cdda0056b39e99880f3..4f81469e28db610ff5cdbe43ea129c46e68967a7 100644
--- a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc
+++ b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc
@@ -207,32 +207,17 @@ void AddToHomescreenDataFetcher::OnDidPerformInstallableCheck(
is_installable_check_complete_ = true;
- bool webapk_compatible = false;
- if (check_webapk_compatibility_) {
- webapk_compatible = (data.error_code == NO_ERROR_DETECTED &&
- AreWebManifestUrlsWebApkCompatible(data.manifest));
- weak_observer_->OnDidDetermineWebApkCompatibility(webapk_compatible);
-
- if (webapk_compatible) {
- // WebAPKs are wholly defined by the Web Manifest. Ignore the <meta> tag
- // data received in OnDidGetWebApplicationInfo().
- shortcut_info_ = ShortcutInfo(GURL());
- }
- }
-
if (!data.manifest.IsEmpty()) {
+ shortcut_info_ = ShortcutInfo(GURL());
+
base::RecordAction(base::UserMetricsAction("webapps.AddShortcut.Manifest"));
shortcut_info_.UpdateFromManifest(data.manifest);
dominickn 2017/06/14 05:16:51 This isn't quite what I was suggesting on the othe
shortcut_info_.manifest_url = data.manifest_url;
+ }
- if (webapk_compatible) {
- shortcut_info_.UpdateSource(ShortcutInfo::SOURCE_ADD_TO_HOMESCREEN_PWA);
-
- if (data.badge_icon && !data.badge_icon->drawsNothing()) {
- shortcut_info_.best_badge_icon_url = data.badge_icon_url;
- badge_icon_ = *data.badge_icon;
- }
- }
+ if (data.badge_icon && !data.badge_icon->drawsNothing()) {
+ shortcut_info_.best_badge_icon_url = data.badge_icon_url;
+ badge_icon_ = *data.badge_icon;
}
// Save the splash screen URL for the later download.
@@ -244,6 +229,16 @@ void AddToHomescreenDataFetcher::OnDidPerformInstallableCheck(
shortcut_info_.minimum_splash_image_size_in_px =
minimum_splash_image_size_in_px_;
+ if (check_webapk_compatibility_) {
+ bool webapk_compatible =
+ (data.error_code == NO_ERROR_DETECTED &&
+ AreWebManifestUrlsWebApkCompatible(data.manifest));
+ weak_observer_->OnDidDetermineWebApkCompatibility(webapk_compatible);
+
+ if (webapk_compatible)
+ shortcut_info_.UpdateSource(ShortcutInfo::SOURCE_ADD_TO_HOMESCREEN_PWA);
+ }
+
weak_observer_->OnUserTitleAvailable(shortcut_info_.user_title);
if (data.primary_icon) {

Powered by Google App Engine
This is Rietveld 408576698