Chromium Code Reviews| Index: chrome/browser/android/webapk/webapk_installer.cc |
| diff --git a/chrome/browser/android/webapk/webapk_installer.cc b/chrome/browser/android/webapk/webapk_installer.cc |
| index 7df48b20facd97280314ca703e2ea27735ab8632..9eb79081493d5844e5b53632ce9b69de1d91eb7e 100644 |
| --- a/chrome/browser/android/webapk/webapk_installer.cc |
| +++ b/chrome/browser/android/webapk/webapk_installer.cc |
| @@ -22,6 +22,7 @@ |
| #include "chrome/browser/android/shortcut_helper.h" |
| #include "chrome/browser/android/webapk/webapk.pb.h" |
| #include "chrome/browser/android/webapk/webapk_icon_hasher.h" |
| +#include "chrome/browser/android/webapk/webapk_install_service.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "components/version_info/version_info.h" |
| @@ -273,11 +274,8 @@ void WebApkInstaller::SetTimeoutMs(int timeout_ms) { |
| void WebApkInstaller::OnInstallFinished( |
| JNIEnv* env, |
| const base::android::JavaParamRef<jobject>& obj, |
| - jboolean success) { |
| - if (success) |
| - OnSuccess(); |
| - else |
| - OnFailure(); |
| + jint result) { |
| + OnResult(static_cast<WebApkInstallResult>(result)); |
| } |
| void WebApkInstaller::BuildWebApkProtoInBackgroundForTesting( |
| @@ -343,6 +341,10 @@ void WebApkInstaller::InstallOrUpdateWebApkFromGooglePlay( |
| } |
| } |
| +void WebApkInstaller::OnSuccess() { |
|
dominickn
2017/03/05 23:52:40
Can you remove this method and just call OnResult
|
| + OnResult(WebApkInstallResult::INSTALLED); |
| +} |
| + |
| WebApkInstaller::WebApkInstaller(content::BrowserContext* browser_context, |
| const ShortcutInfo& shortcut_info, |
| const SkBitmap& shortcut_icon) |
| @@ -626,12 +628,11 @@ void WebApkInstaller::OnTimeout() { |
| OnFailure(); |
| } |
| -void WebApkInstaller::OnSuccess() { |
| - finish_callback_.Run(true, webapk_package_); |
| - delete this; |
| +void WebApkInstaller::OnFailure() { |
|
dominickn
2017/03/05 23:52:40
Can you remove this method and call OnResult direc
|
| + OnResult(WebApkInstallResult::INSTALL_FAILED); |
| } |
| -void WebApkInstaller::OnFailure() { |
| - finish_callback_.Run(false, webapk_package_); |
| +void WebApkInstaller::OnResult(WebApkInstallResult result) { |
| + finish_callback_.Run(result, webapk_package_); |
| delete this; |
| } |