| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_UPDATE_DATA_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_UPDATE_DATA_FETCHER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_UPDATE_DATA_FETCHER_H_ | 6 #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_UPDATE_DATA_FETCHER_H_ |
| 7 | 7 |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_weak_ref.h" | 9 #include "base/android/jni_weak_ref.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // content::WebContentsObserver: | 55 // content::WebContentsObserver: |
| 56 void DidStopLoading() override; | 56 void DidStopLoading() override; |
| 57 | 57 |
| 58 // Fetches the installable data. | 58 // Fetches the installable data. |
| 59 void FetchInstallableData(); | 59 void FetchInstallableData(); |
| 60 | 60 |
| 61 // Called once the installable data has been fetched. | 61 // Called once the installable data has been fetched. |
| 62 void OnDidGetInstallableData(const InstallableData& installable_data); | 62 void OnDidGetInstallableData(const InstallableData& installable_data); |
| 63 | 63 |
| 64 // Called with the computed Murmur2 hash for the app icon. | 64 // Called with the computed Murmur2 hash for the app icon. |
| 65 void OnGotIconMurmur2Hash(const std::string& best_icon_murmur2_hash); | 65 void OnGotIconMurmur2Hash(const std::string& best_primary_icon_murmur2_hash); |
| 66 | 66 |
| 67 void OnDataAvailable(const ShortcutInfo& info, | 67 void OnDataAvailable(const ShortcutInfo& info, |
| 68 const std::string& best_icon_murmur2_hash, | 68 const std::string& best_primary_icon_murmur2_hash, |
| 69 const SkBitmap& best_icon); | 69 const SkBitmap& best_primary_icon); |
| 70 | 70 |
| 71 // Called when a page has no Web Manifest or the Web Manifest is not WebAPK | 71 // Called when a page has no Web Manifest or the Web Manifest is not WebAPK |
| 72 // compatible. | 72 // compatible. |
| 73 void OnWebManifestNotWebApkCompatible(); | 73 void OnWebManifestNotWebApkCompatible(); |
| 74 | 74 |
| 75 // Points to the Java object. | 75 // Points to the Java object. |
| 76 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 76 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
| 77 | 77 |
| 78 // The detector will only fetch the URL within the scope of the WebAPK. | 78 // The detector will only fetch the URL within the scope of the WebAPK. |
| 79 const GURL scope_; | 79 const GURL scope_; |
| 80 | 80 |
| 81 // The WebAPK's Web Manifest URL that the detector is looking for. | 81 // The WebAPK's Web Manifest URL that the detector is looking for. |
| 82 const GURL web_manifest_url_; | 82 const GURL web_manifest_url_; |
| 83 | 83 |
| 84 // Whether this is the initial URL fetch. | 84 // Whether this is the initial URL fetch. |
| 85 bool is_initial_fetch_; | 85 bool is_initial_fetch_; |
| 86 | 86 |
| 87 // The URL for which the installable data is being fetched / was last fetched. | 87 // The URL for which the installable data is being fetched / was last fetched. |
| 88 GURL last_fetched_url_; | 88 GURL last_fetched_url_; |
| 89 | 89 |
| 90 // Downloads app icon and computes Murmur2 hash. | 90 // Downloads app icon and computes Murmur2 hash. |
| 91 std::unique_ptr<WebApkIconHasher> icon_hasher_; | 91 std::unique_ptr<WebApkIconHasher> icon_hasher_; |
| 92 | 92 |
| 93 // Downloaded data for |web_manifest_url_|. | 93 // Downloaded data for |web_manifest_url_|. |
| 94 ShortcutInfo info_; | 94 ShortcutInfo info_; |
| 95 SkBitmap best_icon_; | 95 SkBitmap best_primary_icon_; |
| 96 | 96 |
| 97 base::WeakPtrFactory<WebApkUpdateDataFetcher> weak_ptr_factory_; | 97 base::WeakPtrFactory<WebApkUpdateDataFetcher> weak_ptr_factory_; |
| 98 | 98 |
| 99 DISALLOW_COPY_AND_ASSIGN(WebApkUpdateDataFetcher); | 99 DISALLOW_COPY_AND_ASSIGN(WebApkUpdateDataFetcher); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_UPDATE_DATA_FETCHER_H_ | 102 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_UPDATE_DATA_FETCHER_H_ |
| OLD | NEW |