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 InstallOrUpdateWebApkFromGooglePlay( |
| 431 response->package_name(), version, response->token())) { | 431 response->package_name(), version, response->token()); |
|
pkotwicz
2017/02/03 18:56:32
Why this change? If we are ignoring the return val
Xi Han
2017/02/03 22:16:21
This is because ChromeWebApkHost::CanUseGooglePlay
pkotwicz
2017/02/03 23:05:05
Please file the bug too :)
| |
| 432 OnFailure(); | |
| 433 } | |
| 434 return; | 432 return; |
| 435 } | 433 } |
| 436 | 434 |
| 437 OnGotWebApkDownloadUrl(signed_download_url, response->package_name()); | 435 OnGotWebApkDownloadUrl(signed_download_url, response->package_name()); |
| 438 } | 436 } |
| 439 | 437 |
| 440 void WebApkInstaller::DownloadAppIconAndComputeMurmur2Hash() { | 438 void WebApkInstaller::DownloadAppIconAndComputeMurmur2Hash() { |
| 441 // Safeguard. WebApkIconHasher crashes if asked to fetch an invalid URL. | 439 // Safeguard. WebApkIconHasher crashes if asked to fetch an invalid URL. |
| 442 if (!shortcut_info_.best_icon_url.is_valid()) { | 440 if (!shortcut_info_.best_icon_url.is_valid()) { |
| 443 OnFailure(); | 441 OnFailure(); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 620 | 618 |
| 621 void WebApkInstaller::OnSuccess() { | 619 void WebApkInstaller::OnSuccess() { |
| 622 finish_callback_.Run(true, webapk_package_); | 620 finish_callback_.Run(true, webapk_package_); |
| 623 delete this; | 621 delete this; |
| 624 } | 622 } |
| 625 | 623 |
| 626 void WebApkInstaller::OnFailure() { | 624 void WebApkInstaller::OnFailure() { |
| 627 finish_callback_.Run(false, webapk_package_); | 625 finish_callback_.Run(false, webapk_package_); |
| 628 delete this; | 626 delete this; |
| 629 } | 627 } |
| OLD | NEW |