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

Unified Diff: chrome/browser/android/webapk/webapk_installer.h

Issue 2733543002: [Android:WebAPK] Don't add webapp to homescreen if WebAPK install times out part 1/3 (Closed)
Patch Set: Merge branch 'refactor_shortcut_helper29' into refactor_shortcut_helper3 Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/webapk/webapk_installer.h
diff --git a/chrome/browser/android/webapk/webapk_installer.h b/chrome/browser/android/webapk/webapk_installer.h
index d47d75228d539b788b2933098541c2cca742e5b2..b3c44b70703d86655dedc2747c2bcadf769621d4 100644
--- a/chrome/browser/android/webapk/webapk_installer.h
+++ b/chrome/browser/android/webapk/webapk_installer.h
@@ -32,6 +32,7 @@ namespace webapk {
class WebApk;
}
+enum class WebApkInstallResult;
class WebApkIconHasher;
// Talks to Chrome WebAPK server and Google Play to generate a WebAPK on the
@@ -41,9 +42,10 @@ class WebApkInstaller : public net::URLFetcherDelegate {
public:
// Called when the creation/updating of a WebAPK is finished or failed.
// Parameters:
- // - whether the process succeeds.
+ // - the result of the installation.
// - the package name of the WebAPK.
- using FinishCallback = base::Callback<void(bool, const std::string&)>;
+ using FinishCallback =
+ base::Callback<void(WebApkInstallResult, const std::string&)>;
~WebApkInstaller() override;
@@ -91,7 +93,7 @@ class WebApkInstaller : public net::URLFetcherDelegate {
// Called once the installation is complete or failed.
void OnInstallFinished(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
- jboolean success);
+ jint result);
// Creates a WebApk install or update request.
// Should be used only for testing.
@@ -137,7 +139,7 @@ class WebApkInstaller : public net::URLFetcherDelegate {
int version,
const std::string& token);
- // Called when the request to install the WebAPK is sent to Google Play.
+ // Called when the install or update process has completed.
void OnSuccess();
private:
@@ -227,12 +229,12 @@ class WebApkInstaller : public net::URLFetcherDelegate {
// download times out.
void OnTimeout();
- // Called if a WebAPK could not be created. WebApkInstaller only tracks the
- // WebAPK creation and the WebAPK download. It does not track the
- // WebAPK installation. OnFailure() is not called if the WebAPK could not be
- // installed.
+ // Called if the WebAPK could not be installed or updated.
void OnFailure();
+ // Called when the install or update process has completed or failed.
+ void OnResult(WebApkInstallResult result);
+
net::URLRequestContextGetter* request_context_getter_;
// Sends HTTP request to WebAPK server.

Powered by Google App Engine
This is Rietveld 408576698