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

Side by Side Diff: chrome/browser/android/webapk/webapk_update_data_fetcher.h

Issue 2594813002: Update WebAPKs even if the WebAPK start URL has no Web Manifest (Closed)
Patch Set: Nits. Created 3 years, 12 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 unified diff | Download patch
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_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_icon_murmur2_hash,
69 const SkBitmap& best_icon); 69 const SkBitmap& best_icon);
70 70
71 // Called when a page has no Web Manifest or the Web Manifest is not WebAPK
72 // compatible.
73 void OnWebManifestNotWebApkCompatible();
74
71 // Points to the Java object. 75 // Points to the Java object.
72 base::android::ScopedJavaGlobalRef<jobject> java_ref_; 76 base::android::ScopedJavaGlobalRef<jobject> java_ref_;
73 77
74 // 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.
75 const GURL scope_; 79 const GURL scope_;
76 80
77 // 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.
78 const GURL web_manifest_url_; 82 const GURL web_manifest_url_;
79 83
84 // Whether this is the initial URL fetch.
85 bool is_initial_fetch_;
86
80 // 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.
81 GURL last_fetched_url_; 88 GURL last_fetched_url_;
82 89
83 // Downloads app icon and computes Murmur2 hash. 90 // Downloads app icon and computes Murmur2 hash.
84 std::unique_ptr<WebApkIconHasher> icon_hasher_; 91 std::unique_ptr<WebApkIconHasher> icon_hasher_;
85 92
86 // Downloaded data for |web_manifest_url_|. 93 // Downloaded data for |web_manifest_url_|.
87 ShortcutInfo info_; 94 ShortcutInfo info_;
88 SkBitmap best_icon_; 95 SkBitmap best_icon_;
89 96
90 base::WeakPtrFactory<WebApkUpdateDataFetcher> weak_ptr_factory_; 97 base::WeakPtrFactory<WebApkUpdateDataFetcher> weak_ptr_factory_;
91 98
92 DISALLOW_COPY_AND_ASSIGN(WebApkUpdateDataFetcher); 99 DISALLOW_COPY_AND_ASSIGN(WebApkUpdateDataFetcher);
93 }; 100 };
94 101
95 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_UPDATE_DATA_FETCHER_H_ 102 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_UPDATE_DATA_FETCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698