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

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

Issue 2453423002: Send all of the icon URLs listed in Web Manifest to WebAPK Server. (Closed)
Patch Set: use space to separate icon_url and icon_hash. Created 4 years, 1 month 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_MANIFEST_UPGRADE_DETECTOR_FETCHER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_FETCHER_H_
6 #define CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_FETCHER_H_ 6 #define CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_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
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& 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& icon_murmur2_hash, 68 const std::string& best_icon_murmur2_hash,
69 const SkBitmap& icon); 69 const SkBitmap& best_icon);
70 70
71 // Points to the Java object. 71 // Points to the Java object.
72 base::android::ScopedJavaGlobalRef<jobject> java_ref_; 72 base::android::ScopedJavaGlobalRef<jobject> java_ref_;
73 73
74 // The detector will only fetch the URL within the scope of the WebAPK. 74 // The detector will only fetch the URL within the scope of the WebAPK.
75 const GURL scope_; 75 const GURL scope_;
76 76
77 // The WebAPK's Web Manifest URL that the detector is looking for. 77 // The WebAPK's Web Manifest URL that the detector is looking for.
78 const GURL web_manifest_url_; 78 const GURL web_manifest_url_;
79 79
80 // The URL for which the installable data is being fetched / was last fetched. 80 // The URL for which the installable data is being fetched / was last fetched.
81 GURL last_fetched_url_; 81 GURL last_fetched_url_;
82 82
83 // Downloads app icon and computes Murmur2 hash. 83 // Downloads app icon and computes Murmur2 hash.
84 std::unique_ptr<WebApkIconHasher> icon_hasher_; 84 std::unique_ptr<WebApkIconHasher> icon_hasher_;
85 85
86 // Downloaded data for |web_manifest_url_|. 86 // Downloaded data for |web_manifest_url_|.
87 ShortcutInfo info_; 87 ShortcutInfo info_;
88 SkBitmap icon_; 88 SkBitmap best_icon_;
89 89
90 base::WeakPtrFactory<ManifestUpgradeDetectorFetcher> weak_ptr_factory_; 90 base::WeakPtrFactory<ManifestUpgradeDetectorFetcher> weak_ptr_factory_;
91 91
92 DISALLOW_COPY_AND_ASSIGN(ManifestUpgradeDetectorFetcher); 92 DISALLOW_COPY_AND_ASSIGN(ManifestUpgradeDetectorFetcher);
93 }; 93 };
94 94
95 #endif // CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_FETCHER_H_ 95 #endif // CHROME_BROWSER_ANDROID_WEBAPK_MANIFEST_UPGRADE_DETECTOR_FETCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698