Index: chrome/browser/android/webapk/manifest_upgrade_detector_fetcher.h |
diff --git a/chrome/browser/android/webapk/manifest_upgrade_detector_fetcher.h b/chrome/browser/android/webapk/manifest_upgrade_detector_fetcher.h |
index 7d15aebb733dfc49b920b797b28e0d0ded01fe98..3c0a6f3536e8349209e1764ce69cc943c0444511 100644 |
--- a/chrome/browser/android/webapk/manifest_upgrade_detector_fetcher.h |
+++ b/chrome/browser/android/webapk/manifest_upgrade_detector_fetcher.h |
@@ -9,7 +9,9 @@ |
#include "base/android/jni_weak_ref.h" |
#include "base/macros.h" |
#include "base/memory/weak_ptr.h" |
+#include "chrome/browser/android/shortcut_info.h" |
#include "content/public/browser/web_contents_observer.h" |
+#include "third_party/skia/include/core/SkBitmap.h" |
namespace content { |
struct Manifest; |
@@ -17,9 +19,8 @@ class WebContents; |
} |
class GURL; |
-class SkBitmap; |
struct InstallableData; |
-struct ShortcutInfo; |
+class WebApkIconHasher; |
// ManifestUpgradeDetectorFetcher is the C++ counterpart of |
// org.chromium.chrome.browser's ManifestUpgradeDetectorFetcher in Java. It is |
@@ -58,7 +59,18 @@ class ManifestUpgradeDetectorFetcher : public content::WebContentsObserver { |
// Called once the installable data has been fetched. |
void OnDidGetInstallableData(const InstallableData& installable_data); |
- void OnDataAvailable(const ShortcutInfo& info, const SkBitmap& icon); |
+ // Called with the computed Murmur2 hash for the app icon. |
+ void OnGotIconMurmur2Hash(const std::string& icon_murmur2_hash); |
+ |
+ // Called once the Web Manifest at |web_manifest_url_| has been downloaded if |
+ // the Web Manifest is WebAPK compatible. |
+ void OnGotWebApkCompatibleManifest(const ShortcutInfo& info, |
+ const std::string& icon_murmur2_hash, |
+ const SkBitmap& icon); |
+ |
+ // Called once the Web Manifest at |web_manifest_url_| has been downloaded if |
+ // the Web Manifest is not WebAPK compatible. |
+ void OnGotNonWebApkCompatibleManifest(); |
// Points to the Java object. |
base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
@@ -69,6 +81,13 @@ class ManifestUpgradeDetectorFetcher : public content::WebContentsObserver { |
// The WebAPK's Web Manifest URL that the detector is looking for. |
const GURL web_manifest_url_; |
+ // Downloads app icon and computes Murmur2 hash. |
+ std::unique_ptr<WebApkIconHasher> icon_hasher_; |
+ |
+ // Downloaded data for |web_manifest_url_|. |
+ ShortcutInfo info_; |
+ SkBitmap icon_; |
+ |
base::WeakPtrFactory<ManifestUpgradeDetectorFetcher> weak_ptr_factory_; |
DISALLOW_COPY_AND_ASSIGN(ManifestUpgradeDetectorFetcher); |