| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 DCHECK(installer_task_runner_->RunsTasksOnCurrentThread()); | 441 DCHECK(installer_task_runner_->RunsTasksOnCurrentThread()); |
| 442 | 442 |
| 443 UMA_HISTOGRAM_ENUMERATION("Extensions.UnpackSuccessInstallSource", | 443 UMA_HISTOGRAM_ENUMERATION("Extensions.UnpackSuccessInstallSource", |
| 444 install_source(), Manifest::NUM_LOCATIONS); | 444 install_source(), Manifest::NUM_LOCATIONS); |
| 445 | 445 |
| 446 | 446 |
| 447 UMA_HISTOGRAM_ENUMERATION("Extensions.UnpackSuccessInstallCause", | 447 UMA_HISTOGRAM_ENUMERATION("Extensions.UnpackSuccessInstallCause", |
| 448 install_cause(), | 448 install_cause(), |
| 449 extension_misc::NUM_INSTALL_CAUSES); | 449 extension_misc::NUM_INSTALL_CAUSES); |
| 450 | 450 |
| 451 install_checker_.set_extension(extension); | 451 install_checker_.set_extension(extension, install_flags_); |
| 452 temp_dir_ = temp_dir; | 452 temp_dir_ = temp_dir; |
| 453 if (!install_icon.empty()) | 453 if (!install_icon.empty()) |
| 454 install_icon_.reset(new SkBitmap(install_icon)); | 454 install_icon_.reset(new SkBitmap(install_icon)); |
| 455 | 455 |
| 456 if (original_manifest) | 456 if (original_manifest) |
| 457 original_manifest_.reset(new Manifest( | 457 original_manifest_.reset(new Manifest( |
| 458 Manifest::INVALID_LOCATION, | 458 Manifest::INVALID_LOCATION, |
| 459 scoped_ptr<base::DictionaryValue>(original_manifest->DeepCopy()))); | 459 scoped_ptr<base::DictionaryValue>(original_manifest->DeepCopy()))); |
| 460 | 460 |
| 461 // We don't have to delete the unpack dir explicity since it is a child of | 461 // We don't have to delete the unpack dir explicity since it is a child of |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 // lazily and based on the Extension's root path at that moment. | 716 // lazily and based on the Extension's root path at that moment. |
| 717 // TODO(rdevlin.cronin): Continue removing std::string errors and replacing | 717 // TODO(rdevlin.cronin): Continue removing std::string errors and replacing |
| 718 // with base::string16 | 718 // with base::string16 |
| 719 std::string extension_id = extension()->id(); | 719 std::string extension_id = extension()->id(); |
| 720 std::string error; | 720 std::string error; |
| 721 install_checker_.set_extension( | 721 install_checker_.set_extension( |
| 722 file_util::LoadExtension( | 722 file_util::LoadExtension( |
| 723 version_dir, | 723 version_dir, |
| 724 install_source_, | 724 install_source_, |
| 725 extension()->creation_flags() | Extension::REQUIRE_KEY, | 725 extension()->creation_flags() | Extension::REQUIRE_KEY, |
| 726 &error).get()); | 726 &error).get(), |
| 727 install_flags_); |
| 727 | 728 |
| 728 if (extension()) { | 729 if (extension()) { |
| 729 ReportSuccessFromFileThread(); | 730 ReportSuccessFromFileThread(); |
| 730 } else { | 731 } else { |
| 731 LOG(ERROR) << error << " " << extension_id << " " << download_url_; | 732 LOG(ERROR) << error << " " << extension_id << " " << download_url_; |
| 732 ReportFailureFromFileThread(CrxInstallerError(base::UTF8ToUTF16(error))); | 733 ReportFailureFromFileThread(CrxInstallerError(base::UTF8ToUTF16(error))); |
| 733 } | 734 } |
| 734 } | 735 } |
| 735 | 736 |
| 736 void CrxInstaller::ReportFailureFromFileThread(const CrxInstallerError& error) { | 737 void CrxInstaller::ReportFailureFromFileThread(const CrxInstallerError& error) { |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) | 895 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) |
| 895 return; | 896 return; |
| 896 | 897 |
| 897 if (client_) { | 898 if (client_) { |
| 898 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). | 899 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). |
| 899 client_->ConfirmReEnable(this, extension()); | 900 client_->ConfirmReEnable(this, extension()); |
| 900 } | 901 } |
| 901 } | 902 } |
| 902 | 903 |
| 903 } // namespace extensions | 904 } // namespace extensions |
| OLD | NEW |