Commit 73f12a72 authored by pkotwicz's avatar pkotwicz Committed by Commit bot

Do not create WebAPK via add-to-homescreen menu item if manifest is not WebAPK-compatible

This CL prevents creating WebAPKs via the add-to-homescreen menu item:
- If the Web Manifest does not contain any icons
- If any URL in the Web Manifest contains a username and password

This makes the logic in add_to_homescreen_data_fetcher.cc match the logic in
app_banner_manager_android.cc

BUG=648491
TEST=None

Review-Url: https://codereview.chromium.org/2349263003
Cr-Commit-Position: refs/heads/master@{#419949}
parent 6adb5614
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "chrome/browser/android/offline_pages/offline_page_utils.h" #include "chrome/browser/android/offline_pages/offline_page_utils.h"
#include "chrome/browser/android/shortcut_helper.h" #include "chrome/browser/android/shortcut_helper.h"
#include "chrome/browser/android/webapk/webapk_web_manifest_checker.h"
#include "chrome/browser/favicon/favicon_service_factory.h" #include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/installable/installable_manager.h" #include "chrome/browser/installable/installable_manager.h"
#include "chrome/browser/manifest/manifest_icon_selector.h" #include "chrome/browser/manifest/manifest_icon_selector.h"
...@@ -205,8 +206,12 @@ void AddToHomescreenDataFetcher::OnDidPerformInstallableCheck( ...@@ -205,8 +206,12 @@ void AddToHomescreenDataFetcher::OnDidPerformInstallableCheck(
is_installable_check_complete_ = true; is_installable_check_complete_ = true;
if (check_webapk_compatibility_) if (check_webapk_compatibility_) {
weak_observer_->OnDidDetermineWebApkCompatibility(data.is_installable); bool webapk_compatible =
(data.error_code == NO_ERROR_DETECTED &&
AreWebManifestUrlsWebApkCompatible(data.manifest));
weak_observer_->OnDidDetermineWebApkCompatibility(webapk_compatible);
}
if (!data.manifest.IsEmpty()) { if (!data.manifest.IsEmpty()) {
content::RecordAction( content::RecordAction(
......
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