| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/unpacked_installer.h" | 5 #include "chrome/browser/extensions/unpacked_installer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 if (!service || service->browser_terminating()) | 214 if (!service || service->browser_terminating()) |
| 215 return; | 215 return; |
| 216 | 216 |
| 217 // TODO(crbug.com/420147): Move this code to a utility class to avoid | 217 // TODO(crbug.com/420147): Move this code to a utility class to avoid |
| 218 // duplication of SharedModuleService::CheckImports code. | 218 // duplication of SharedModuleService::CheckImports code. |
| 219 if (SharedModuleInfo::ImportsModules(extension())) { | 219 if (SharedModuleInfo::ImportsModules(extension())) { |
| 220 const std::vector<SharedModuleInfo::ImportInfo>& imports = | 220 const std::vector<SharedModuleInfo::ImportInfo>& imports = |
| 221 SharedModuleInfo::GetImports(extension()); | 221 SharedModuleInfo::GetImports(extension()); |
| 222 std::vector<SharedModuleInfo::ImportInfo>::const_iterator i; | 222 std::vector<SharedModuleInfo::ImportInfo>::const_iterator i; |
| 223 for (i = imports.begin(); i != imports.end(); ++i) { | 223 for (i = imports.begin(); i != imports.end(); ++i) { |
| 224 Version version_required(i->minimum_version); | 224 base::Version version_required(i->minimum_version); |
| 225 const Extension* imported_module = | 225 const Extension* imported_module = |
| 226 service->GetExtensionById(i->extension_id, true); | 226 service->GetExtensionById(i->extension_id, true); |
| 227 if (!imported_module) { | 227 if (!imported_module) { |
| 228 ReportExtensionLoadError(kImportMissing); | 228 ReportExtensionLoadError(kImportMissing); |
| 229 return; | 229 return; |
| 230 } else if (imported_module && | 230 } else if (imported_module && |
| 231 !SharedModuleInfo::IsSharedModule(imported_module)) { | 231 !SharedModuleInfo::IsSharedModule(imported_module)) { |
| 232 ReportExtensionLoadError(kImportNotSharedModule); | 232 ReportExtensionLoadError(kImportNotSharedModule); |
| 233 return; | 233 return; |
| 234 } else if (imported_module && (version_required.IsValid() && | 234 } else if (imported_module && (version_required.IsValid() && |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 service_weak_->OnExtensionInstalled( | 376 service_weak_->OnExtensionInstalled( |
| 377 extension(), syncer::StringOrdinal(), kInstallFlagInstallImmediately); | 377 extension(), syncer::StringOrdinal(), kInstallFlagInstallImmediately); |
| 378 | 378 |
| 379 if (!callback_.is_null()) { | 379 if (!callback_.is_null()) { |
| 380 callback_.Run(extension(), extension_path_, std::string()); | 380 callback_.Run(extension(), extension_path_, std::string()); |
| 381 callback_.Reset(); | 381 callback_.Reset(); |
| 382 } | 382 } |
| 383 } | 383 } |
| 384 | 384 |
| 385 } // namespace extensions | 385 } // namespace extensions |
| OLD | NEW |