| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 // We are downloading a shared module. We need create an approval for it. | 489 // We are downloading a shared module. We need create an approval for it. |
| 490 std::unique_ptr<Approval> approval = | 490 std::unique_ptr<Approval> approval = |
| 491 Approval::CreateForSharedModule(profile_); | 491 Approval::CreateForSharedModule(profile_); |
| 492 const SharedModuleInfo::ImportInfo& info = pending_modules_.front(); | 492 const SharedModuleInfo::ImportInfo& info = pending_modules_.front(); |
| 493 approval->extension_id = info.extension_id; | 493 approval->extension_id = info.extension_id; |
| 494 const base::Version version_required(info.minimum_version); | 494 const base::Version version_required(info.minimum_version); |
| 495 | 495 |
| 496 if (version_required.IsValid()) { | 496 if (version_required.IsValid()) { |
| 497 approval->minimum_version.reset(new base::Version(version_required)); | 497 approval->minimum_version.reset(new base::Version(version_required)); |
| 498 } | 498 } |
| 499 download_item_->SetUserData(kApprovalKey, approval.release()); | 499 download_item_->SetUserData(kApprovalKey, std::move(approval)); |
| 500 } else { | 500 } else { |
| 501 // It is for the main module of the extension. We should use the provided | 501 // It is for the main module of the extension. We should use the provided |
| 502 // |approval_|. | 502 // |approval_|. |
| 503 if (approval_) | 503 if (approval_) |
| 504 download_item_->SetUserData(kApprovalKey, approval_.release()); | 504 download_item_->SetUserData(kApprovalKey, std::move(approval_)); |
| 505 } | 505 } |
| 506 | 506 |
| 507 if (!download_started_) { | 507 if (!download_started_) { |
| 508 if (delegate_) | 508 if (delegate_) |
| 509 delegate_->OnExtensionDownloadStarted(id_, download_item_); | 509 delegate_->OnExtensionDownloadStarted(id_, download_item_); |
| 510 download_started_ = true; | 510 download_started_ = true; |
| 511 } | 511 } |
| 512 } | 512 } |
| 513 | 513 |
| 514 void WebstoreInstaller::OnDownloadUpdated(DownloadItem* download) { | 514 void WebstoreInstaller::OnDownloadUpdated(DownloadItem* download) { |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 1, | 790 1, |
| 791 kMaxSizeKb, | 791 kMaxSizeKb, |
| 792 kNumBuckets); | 792 kNumBuckets); |
| 793 } | 793 } |
| 794 UMA_HISTOGRAM_BOOLEAN( | 794 UMA_HISTOGRAM_BOOLEAN( |
| 795 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown", | 795 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown", |
| 796 total_bytes <= 0); | 796 total_bytes <= 0); |
| 797 } | 797 } |
| 798 | 798 |
| 799 } // namespace extensions | 799 } // namespace extensions |
| OLD | NEW |