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

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

Issue 2050933002: Upstream: Add additional checks before creating a WebAPK after clicking "Add to Homescreen" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'create_webapk_requirements_enum_class' into create_webapk_requirements2 Created 4 years, 5 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.h
diff --git a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h
index d02b94576e07aa3f981ee13c89db80f71d8d2554..7246b71572197abcbe3d33326838da759abdf4df 100644
--- a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h
+++ b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h
@@ -74,6 +74,16 @@ class AddToHomescreenDataFetcher
void OnDidGetManifest(const GURL& manifest_url,
const content::Manifest& manifest);
+ // Called once it has been determined whether there is a service worker
+ // controlling the page. Only pages controlled by a service worker are
+ // WebAPK-capable.
+ void OnDidCheckServiceWorkerForWebApk(const content::Manifest& manifest,
+ bool has_service_worker);
+
+ // Called once it has been determined whether a WebAPK should be created for
+ // the page.
+ void OnCheckIsWebApk(const content::Manifest& manifest, bool is_webapk);
+
// Accessors, etc.
void set_weak_observer(Observer* observer) { weak_observer_ = observer; }
bool is_ready() { return is_ready_; }
@@ -107,12 +117,19 @@ class AddToHomescreenDataFetcher
// appropriate for a home screen shortcut.
GURL GetShortcutUrl(const GURL& original_url);
+ // Returns whether a WebAPK can be built for |manifest|.
+ bool IsManifestWebApkCapable(const content::Manifest& manifest) const;
+
Observer* weak_observer_;
bool is_waiting_for_web_application_info_;
bool is_icon_saved_;
bool is_ready_;
base::Timer icon_timeout_timer_;
+
+ // The web page's current URL.
+ GURL shortcut_url_;
+
ShortcutInfo shortcut_info_;
GURL splash_screen_url_;
« no previous file with comments | « chrome/browser/android/shortcut_info.cc ('k') | chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698