| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 // content::WebContentsObserver: | 54 // content::WebContentsObserver: |
| 55 void DidStopLoading() override; | 55 void DidStopLoading() override; |
| 56 | 56 |
| 57 // Fetches the installable data. | 57 // Fetches the installable data. |
| 58 void FetchInstallableData(); | 58 void FetchInstallableData(); |
| 59 | 59 |
| 60 // Called once the installable data has been fetched. | 60 // Called once the installable data has been fetched. |
| 61 void OnDidGetInstallableData(const InstallableData& installable_data); | 61 void OnDidGetInstallableData(const InstallableData& installable_data); |
| 62 | 62 |
| 63 // Called with the computed Murmur2 hash for the app icon. | 63 // Called with the computed Murmur2 hash for the primary icon. |
| 64 void OnGotIconMurmur2Hash(const std::string& best_primary_icon_murmur2_hash); | 64 void OnGotPrimaryIconMurmur2Hash(const std::string& primary_icon_hash); |
| 65 | 65 |
| 66 void OnDataAvailable(const ShortcutInfo& info, | 66 void OnDataAvailable(const ShortcutInfo& info, |
| 67 const std::string& best_primary_icon_murmur2_hash, | 67 const SkBitmap& primary_icon, |
| 68 const SkBitmap& best_primary_icon); | 68 const std::string& primary_icon_murmur2_hash, |
| 69 bool did_fetch_badge_icon, |
| 70 const SkBitmap& badge_icon, |
| 71 const std::string& badge_icon_murmur2_hash); |
| 69 | 72 |
| 70 // Called when a page has no Web Manifest or the Web Manifest is not WebAPK | 73 // Called when a page has no Web Manifest or the Web Manifest is not WebAPK |
| 71 // compatible. | 74 // compatible. |
| 72 void OnWebManifestNotWebApkCompatible(); | 75 void OnWebManifestNotWebApkCompatible(); |
| 73 | 76 |
| 74 // Points to the Java object. | 77 // Points to the Java object. |
| 75 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 78 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
| 76 | 79 |
| 77 // The detector will only fetch the URL within the scope of the WebAPK. | 80 // The detector will only fetch the URL within the scope of the WebAPK. |
| 78 const GURL scope_; | 81 const GURL scope_; |
| 79 | 82 |
| 80 // The WebAPK's Web Manifest URL that the detector is looking for. | 83 // The WebAPK's Web Manifest URL that the detector is looking for. |
| 81 const GURL web_manifest_url_; | 84 const GURL web_manifest_url_; |
| 82 | 85 |
| 83 // Whether this is the initial URL fetch. | 86 // Whether this is the initial URL fetch. |
| 84 bool is_initial_fetch_; | 87 bool is_initial_fetch_; |
| 85 | 88 |
| 86 // The URL for which the installable data is being fetched / was last fetched. | 89 // The URL for which the installable data is being fetched / was last fetched. |
| 87 GURL last_fetched_url_; | 90 GURL last_fetched_url_; |
| 88 | 91 |
| 89 // Downloaded data for |web_manifest_url_|. | 92 // Downloaded data for |web_manifest_url_|. |
| 90 ShortcutInfo info_; | 93 ShortcutInfo info_; |
| 91 SkBitmap best_primary_icon_; | 94 SkBitmap primary_icon_; |
| 95 SkBitmap badge_icon_; |
| 92 | 96 |
| 93 base::WeakPtrFactory<WebApkUpdateDataFetcher> weak_ptr_factory_; | 97 base::WeakPtrFactory<WebApkUpdateDataFetcher> weak_ptr_factory_; |
| 94 | 98 |
| 95 DISALLOW_COPY_AND_ASSIGN(WebApkUpdateDataFetcher); | 99 DISALLOW_COPY_AND_ASSIGN(WebApkUpdateDataFetcher); |
| 96 }; | 100 }; |
| 97 | 101 |
| 98 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_UPDATE_DATA_FETCHER_H_ | 102 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_UPDATE_DATA_FETCHER_H_ |
| OLD | NEW |