Index: extensions/browser/updater/update_install_shim.cc |
diff --git a/extensions/browser/updater/update_install_shim.cc b/extensions/browser/updater/update_install_shim.cc |
index 4072a85d1d774932663baf0fc78d9e7309cb6680..671303b7598cf485d21393546570f8bab9af4f9b 100644 |
--- a/extensions/browser/updater/update_install_shim.cc |
+++ b/extensions/browser/updater/update_install_shim.cc |
@@ -11,10 +11,16 @@ |
#include "base/logging.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/values.h" |
+#include "components/update_client/update_client_errors.h" |
#include "content/public/browser/browser_thread.h" |
namespace extensions { |
+namespace { |
+using InstallError = update_client::InstallError; |
+using Result = update_client::CrxInstaller::Result; |
+} // namespace |
+ |
UpdateInstallShim::UpdateInstallShim(std::string extension_id, |
const base::FilePath& extension_root, |
const UpdateInstallShimCallback& callback) |
@@ -26,11 +32,11 @@ void UpdateInstallShim::OnUpdateError(int error) { |
VLOG(1) << "OnUpdateError (" << extension_id_ << ") " << error; |
} |
-bool UpdateInstallShim::Install(const base::DictionaryValue& manifest, |
- const base::FilePath& unpack_path) { |
+Result UpdateInstallShim::Install(const base::DictionaryValue& manifest, |
+ const base::FilePath& unpack_path) { |
base::ScopedTempDir temp_dir; |
if (!temp_dir.CreateUniqueTempDir()) |
- return false; |
+ return Result(InstallError::GENERIC_ERROR); |
// The UpdateClient code will delete unpack_path if it still exists after |
// this method is done, so we rename it on top of our temp dir. |
@@ -39,13 +45,13 @@ bool UpdateInstallShim::Install(const base::DictionaryValue& manifest, |
LOG(ERROR) << "Trying to install update for " << extension_id_ |
<< "and failed to move " << unpack_path.value() << " to " |
<< temp_dir.GetPath().value(); |
- return false; |
+ return Result(InstallError::GENERIC_ERROR); |
} |
content::BrowserThread::PostTask( |
content::BrowserThread::UI, FROM_HERE, |
base::Bind(&UpdateInstallShim::RunCallbackOnUIThread, this, |
temp_dir.Take())); |
- return true; |
+ return Result(InstallError::NONE); |
} |
bool UpdateInstallShim::GetInstalledFile(const std::string& file, |