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/webstore_installer.h" | 5 #include "chrome/browser/extensions/webstore_installer.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 extension_service(); | 670 extension_service(); |
671 CHECK(service); | 671 CHECK(service); |
672 | 672 |
673 const Approval* approval = GetAssociatedApproval(download); | 673 const Approval* approval = GetAssociatedApproval(download); |
674 DCHECK(approval); | 674 DCHECK(approval); |
675 | 675 |
676 crx_installer_ = download_crx_util::CreateCrxInstaller(profile_, download); | 676 crx_installer_ = download_crx_util::CreateCrxInstaller(profile_, download); |
677 | 677 |
678 crx_installer_->set_expected_id(approval->extension_id); | 678 crx_installer_->set_expected_id(approval->extension_id); |
679 crx_installer_->set_is_gallery_install(true); | 679 crx_installer_->set_is_gallery_install(true); |
680 crx_installer_->set_allow_silent_install(true); | 680 crx_installer_->set_allow_silent_install(CrxInstaller::GRANT_SILENTLY); |
681 | 681 |
682 crx_installer_->InstallCrx(download.GetFullPath()); | 682 crx_installer_->InstallCrx(download.GetFullPath()); |
683 } | 683 } |
684 | 684 |
685 void WebstoreInstaller::ReportFailure(const std::string& error, | 685 void WebstoreInstaller::ReportFailure(const std::string& error, |
686 FailureReason reason) { | 686 FailureReason reason) { |
687 if (delegate_) { | 687 if (delegate_) { |
688 delegate_->OnExtensionInstallFailure(id_, error, reason); | 688 delegate_->OnExtensionInstallFailure(id_, error, reason); |
689 delegate_ = NULL; | 689 delegate_ = NULL; |
690 } | 690 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 1, | 726 1, |
727 kMaxSizeKb, | 727 kMaxSizeKb, |
728 kNumBuckets); | 728 kNumBuckets); |
729 } | 729 } |
730 UMA_HISTOGRAM_BOOLEAN( | 730 UMA_HISTOGRAM_BOOLEAN( |
731 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown", | 731 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown", |
732 total_bytes <= 0); | 732 total_bytes <= 0); |
733 } | 733 } |
734 | 734 |
735 } // namespace extensions | 735 } // namespace extensions |
OLD | NEW |