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

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 'start' into refactor_shortcut_helper3 Created 3 years, 9 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 ea049d7fb428c7f9261a75e65bd551845bad4c1d..999751a1d7f87da62ead6246a23774086c3534dd 100644
--- a/chrome/browser/android/webapk/webapk_installer.h
+++ b/chrome/browser/android/webapk/webapk_installer.h
@@ -15,6 +15,7 @@
#include "base/memory/weak_ptr.h"
#include "base/timer/timer.h"
#include "chrome/browser/android/shortcut_info.h"
+#include "chrome/browser/android/webapk/webapk_install_service.h"
#include "chrome/browser/net/file_downloader.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
@@ -39,13 +40,7 @@ class WebApkIconHasher;
// Java WebApkInstaller counterpart.
class WebApkInstaller : public net::URLFetcherDelegate {
public:
- // Called when the creation/updating of a WebAPK is finished or failed.
- // Parameters:
- // - whether the process succeeds.
- // - the package name of the WebAPK.
- // - true if Chrome received a "request updates less frequently" directive
- // from the WebAPK server.
- using FinishCallback = base::Callback<void(bool, bool, const std::string&)>;
+ using FinishCallback = WebApkInstallService::FinishCallback;
~WebApkInstaller() override;
@@ -93,7 +88,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.
@@ -134,8 +129,8 @@ class WebApkInstaller : public net::URLFetcherDelegate {
int version,
const std::string& token);
- // Called when the request to install the WebAPK is sent to Google Play.
- void OnSuccess();
+ // Called when the install or update process has completed or failed.
+ void OnResult(WebApkInstallResult result);
private:
enum TaskType {
@@ -220,16 +215,6 @@ class WebApkInstaller : public net::URLFetcherDelegate {
void OnWebApkMadeWorldReadable(const base::FilePath& file_path,
bool change_permission_success);
- // Called when the request to the WebAPK server times out or when the WebAPK
- // 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.
- void OnFailure();
-
net::URLRequestContextGetter* request_context_getter_;
// Sends HTTP request to WebAPK server.
« no previous file with comments | « chrome/browser/android/webapk/webapk_install_service.cc ('k') | chrome/browser/android/webapk/webapk_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698