| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 AddRef(); // Balanced in ReportSuccess and ReportFailure. | 302 AddRef(); // Balanced in ReportSuccess and ReportFailure. |
| 303 | 303 |
| 304 if (!crx_file::id_util::IdIsValid(id_)) { | 304 if (!crx_file::id_util::IdIsValid(id_)) { |
| 305 ReportFailure(kInvalidIdError, FAILURE_REASON_OTHER); | 305 ReportFailure(kInvalidIdError, FAILURE_REASON_OTHER); |
| 306 return; | 306 return; |
| 307 } | 307 } |
| 308 | 308 |
| 309 ExtensionService* extension_service = | 309 ExtensionService* extension_service = |
| 310 ExtensionSystem::Get(profile_)->extension_service(); | 310 ExtensionSystem::Get(profile_)->extension_service(); |
| 311 if (approval_.get() && approval_->dummy_extension.get()) { | 311 if (approval_.get() && approval_->dummy_extension.get()) { |
| 312 SharedModuleService::ImportStatus status = | 312 extension_service->shared_module_service()->CheckImports( |
| 313 extension_service->shared_module_service()->CheckImports( | 313 approval_->dummy_extension.get(), &pending_modules_, &pending_modules_); |
| 314 approval_->dummy_extension.get(), | 314 // Do not check the return value of CheckImports, the CRX installer |
| 315 &pending_modules_, | 315 // will report appropriate error messages and fail to install if there |
| 316 &pending_modules_); | 316 // is an import error. |
| 317 // For this case, it is because some imports are not shared modules. | |
| 318 if (status == SharedModuleService::IMPORT_STATUS_UNRECOVERABLE) { | |
| 319 ReportFailure(kDependencyNotSharedModuleError, | |
| 320 FAILURE_REASON_DEPENDENCY_NOT_SHARED_MODULE); | |
| 321 return; | |
| 322 } | |
| 323 } | 317 } |
| 324 | 318 |
| 325 // Add the extension main module into the list. | 319 // Add the extension main module into the list. |
| 326 SharedModuleInfo::ImportInfo info; | 320 SharedModuleInfo::ImportInfo info; |
| 327 info.extension_id = id_; | 321 info.extension_id = id_; |
| 328 pending_modules_.push_back(info); | 322 pending_modules_.push_back(info); |
| 329 | 323 |
| 330 total_modules_ = pending_modules_.size(); | 324 total_modules_ = pending_modules_.size(); |
| 331 | 325 |
| 332 std::set<std::string> ids; | 326 std::set<std::string> ids; |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 1, | 739 1, |
| 746 kMaxSizeKb, | 740 kMaxSizeKb, |
| 747 kNumBuckets); | 741 kNumBuckets); |
| 748 } | 742 } |
| 749 UMA_HISTOGRAM_BOOLEAN( | 743 UMA_HISTOGRAM_BOOLEAN( |
| 750 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown", | 744 "Extensions.WebstoreDownload.InterruptTotalSizeUnknown", |
| 751 total_bytes <= 0); | 745 total_bytes <= 0); |
| 752 } | 746 } |
| 753 | 747 |
| 754 } // namespace extensions | 748 } // namespace extensions |
| OLD | NEW |