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

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

Issue 2362813003: Make it clear that AddToHomescreenDataFetcher ignores WebApplicationInfo for WebAPK compatible pages (Closed)
Patch Set: Created 4 years, 3 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 7d107a22b8624ec026336548246b366c197c2d87..bb0007de15450f574e4deee7aafb2e9d8c88cd53 100644
--- a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc
+++ b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc
@@ -113,8 +113,6 @@ void AddToHomescreenDataFetcher::OnDidGetWebApplicationInfo(
WebApplicationInfo web_app_info = received_web_app_info;
web_app_info.title =
web_app_info.title.substr(0, chrome::kMaxMetaTagAttributeLength);
- web_app_info.description =
- web_app_info.description.substr(0, chrome::kMaxMetaTagAttributeLength);
Xi Han 2016/09/26 17:48:12 Doesn't regular web app still need this?
pkotwicz 2016/09/26 20:13:47 |web_app_info| is a variable which is local to the
Xi Han 2016/09/26 20:15:41 Acknowledged.
// Simply set the user-editable title to be the page's title
shortcut_info_.user_title = web_app_info.title.empty()
@@ -205,8 +203,17 @@ void AddToHomescreenDataFetcher::OnDidPerformInstallableCheck(
is_installable_check_complete_ = true;
- if (check_webapk_compatibility_)
- weak_observer_->OnDidDetermineWebApkCompatibility(data.is_installable);
+ bool webapk_compatible = false;
+ if (check_webapk_compatibility_) {
+ webapk_compatible = data.is_installable;
+ weak_observer_->OnDidDetermineWebApkCompatibility(webapk_compatible);
+ }
+
+ // WebAPKs are wholly defined by the Web Manifest. Ignore the <meta> tag
+ // data received in OnDidGetWebApplicationInfo().
+ if (webapk_compatible) {
+ shortcut_info_ = ShortcutInfo(GURL());
dominickn 2016/09/27 01:51:28 Nit: remove braces. Also, move this check into the
+ }
if (!data.manifest.IsEmpty()) {
content::RecordAction(

Powered by Google App Engine
This is Rietveld 408576698