Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "chrome/browser/android/webapk/webapk_installer.h" | 5 #include "chrome/browser/android/webapk/webapk_installer.h" |
| 6 | 6 |
| 7 #include "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/android/path_utils.h" | 10 #include "base/android/path_utils.h" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 420 | 420 |
| 421 GURL signed_download_url(response->signed_download_url()); | 421 GURL signed_download_url(response->signed_download_url()); |
| 422 if (!signed_download_url.is_valid() || response->package_name().empty()) { | 422 if (!signed_download_url.is_valid() || response->package_name().empty()) { |
| 423 OnFailure(); | 423 OnFailure(); |
| 424 return; | 424 return; |
| 425 } | 425 } |
| 426 | 426 |
| 427 if (CanUseGooglePlayInstallService()) { | 427 if (CanUseGooglePlayInstallService()) { |
| 428 int version = 1; | 428 int version = 1; |
| 429 base::StringToInt(response->version(), &version); | 429 base::StringToInt(response->version(), &version); |
| 430 if (!InstallOrUpdateWebApkFromGooglePlay( | 430 // TODO(hanxi): crbug.com/688759. Removes the return value of |
| 431 response->package_name(), version, response->token())) { | 431 // |InstallOrUpdateWebApkFromGooglePlay()| which is executed asynchronously. |
|
pkotwicz
2017/02/05 02:13:55
Nits:
"Removes" -> "Remove"
"|InstallOrUpdateWebAp
Xi Han
2017/02/06 18:03:44
How about "Remove the return value of InstallOrUpd
pkotwicz
2017/02/06 23:12:12
One small nit: "is either" -> "has either"
Otherwi
Xi Han
2017/02/07 02:52:10
Done.
| |
| 432 OnFailure(); | 432 InstallOrUpdateWebApkFromGooglePlay( |
| 433 } | 433 response->package_name(), version, response->token()); |
| 434 return; | 434 return; |
| 435 } | 435 } |
| 436 | 436 |
| 437 OnGotWebApkDownloadUrl(signed_download_url, response->package_name()); | 437 OnGotWebApkDownloadUrl(signed_download_url, response->package_name()); |
| 438 } | 438 } |
| 439 | 439 |
| 440 void WebApkInstaller::DownloadAppIconAndComputeMurmur2Hash() { | 440 void WebApkInstaller::DownloadAppIconAndComputeMurmur2Hash() { |
| 441 // Safeguard. WebApkIconHasher crashes if asked to fetch an invalid URL. | 441 // Safeguard. WebApkIconHasher crashes if asked to fetch an invalid URL. |
| 442 if (!shortcut_info_.best_icon_url.is_valid()) { | 442 if (!shortcut_info_.best_icon_url.is_valid()) { |
| 443 OnFailure(); | 443 OnFailure(); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 620 | 620 |
| 621 void WebApkInstaller::OnSuccess() { | 621 void WebApkInstaller::OnSuccess() { |
| 622 finish_callback_.Run(true, webapk_package_); | 622 finish_callback_.Run(true, webapk_package_); |
| 623 delete this; | 623 delete this; |
| 624 } | 624 } |
| 625 | 625 |
| 626 void WebApkInstaller::OnFailure() { | 626 void WebApkInstaller::OnFailure() { |
| 627 finish_callback_.Run(false, webapk_package_); | 627 finish_callback_.Run(false, webapk_package_); |
| 628 delete this; | 628 delete this; |
| 629 } | 629 } |
| OLD | NEW |