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

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

Issue 2124513002: Introduce ManifestUpgradeDetector for WebAPK to detect web manifest changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Introduce manifest upgrade detector. 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..d4fad1edbf4633e139bc874337f749dd86693176 100644
--- a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h
+++ b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h
@@ -38,6 +38,8 @@ class AddToHomescreenDataFetcher
public:
class Observer {
public:
+ virtual void OnDidHasManifest(bool has_manifest) = 0;
+
// Called when the title of the page is available.
virtual void OnUserTitleAvailable(const base::string16& title) = 0;
@@ -50,7 +52,8 @@ class AddToHomescreenDataFetcher
// Called when all the data needed to create a shortcut is available.
virtual void OnDataAvailable(const ShortcutInfo& info,
- const SkBitmap& icon) = 0;
+ const SkBitmap& icon,
+ const std::vector<std::string>& icon_urls) = 0;
};
// Initialize the fetcher by requesting the information about the page to the
@@ -61,8 +64,12 @@ class AddToHomescreenDataFetcher
int minimum_icon_size_in_dp,
int ideal_splash_image_size_in_dp,
int minimum_splash_image_size_in_dp,
+ bool stop_fetch_when_no_manifest,
Observer* observer);
+ // Replaces the WebContents that is being observed.
+ void ReplaceWebContents(content::WebContents* web_contents);
+
// Returns a callback which fetches the splash screen image to be stored for
// the webapp with the specified |id|.
base::Closure FetchSplashScreenImageCallback(const std::string& id);
@@ -70,6 +77,8 @@ class AddToHomescreenDataFetcher
// IPC message received when the initialization is finished.
void OnDidGetWebApplicationInfo(const WebApplicationInfo& web_app_info);
+ void OnDidHasManifest(bool has_manifest);
+
// Called when the Manifest has been parsed, or if no Manifest was found.
void OnDidGetManifest(const GURL& manifest_url,
const content::Manifest& manifest);
@@ -116,6 +125,7 @@ class AddToHomescreenDataFetcher
ShortcutInfo shortcut_info_;
GURL splash_screen_url_;
+ std::vector<std::string> icon_urls_;
// The icon must only be set on the UI thread for thread safety.
SkBitmap shortcut_icon_;
base::CancelableTaskTracker favicon_task_tracker_;
@@ -125,6 +135,8 @@ class AddToHomescreenDataFetcher
const int ideal_splash_image_size_in_dp_;
const int minimum_splash_image_size_in_dp_;
+ const bool stop_fetch_when_no_manifest_;
+
friend class base::RefCounted<AddToHomescreenDataFetcher>;
DISALLOW_COPY_AND_ASSIGN(AddToHomescreenDataFetcher);
};

Powered by Google App Engine
This is Rietveld 408576698