| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/shared_module_service.h" | 5 #include "chrome/browser/extensions/shared_module_service.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/version.h" | 9 #include "base/version.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 ExtensionRegistry::EVERYTHING); | 55 ExtensionRegistry::EVERYTHING); |
| 56 if (!imported_module) { | 56 if (!imported_module) { |
| 57 if (extension->from_webstore()) { | 57 if (extension->from_webstore()) { |
| 58 status = IMPORT_STATUS_UNSATISFIED; | 58 status = IMPORT_STATUS_UNSATISFIED; |
| 59 missing_modules->push_back(*iter); | 59 missing_modules->push_back(*iter); |
| 60 } else { | 60 } else { |
| 61 return IMPORT_STATUS_UNRECOVERABLE; | 61 return IMPORT_STATUS_UNRECOVERABLE; |
| 62 } | 62 } |
| 63 } else if (!SharedModuleInfo::IsSharedModule(imported_module)) { | 63 } else if (!SharedModuleInfo::IsSharedModule(imported_module)) { |
| 64 return IMPORT_STATUS_UNRECOVERABLE; | 64 return IMPORT_STATUS_UNRECOVERABLE; |
| 65 } else if (!SharedModuleInfo::IsExportAllowedByWhitelist(imported_module, |
| 66 extension->id())) { |
| 67 return IMPORT_STATUS_UNRECOVERABLE; |
| 65 } else if (version_required.IsValid() && | 68 } else if (version_required.IsValid() && |
| 66 imported_module->version()->CompareTo(version_required) < 0) { | 69 imported_module->version()->CompareTo(version_required) < 0) { |
| 67 if (imported_module->from_webstore()) { | 70 if (imported_module->from_webstore()) { |
| 68 outdated_modules->push_back(*iter); | 71 outdated_modules->push_back(*iter); |
| 69 status = IMPORT_STATUS_UNSATISFIED; | 72 status = IMPORT_STATUS_UNSATISFIED; |
| 70 } else { | 73 } else { |
| 71 return IMPORT_STATUS_UNRECOVERABLE; | 74 return IMPORT_STATUS_UNRECOVERABLE; |
| 72 } | 75 } |
| 73 } | 76 } |
| 74 } | 77 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 void SharedModuleService::OnExtensionUninstalled(const Extension* extension) { | 164 void SharedModuleService::OnExtensionUninstalled(const Extension* extension) { |
| 162 PruneSharedModulesOnUninstall(extension); | 165 PruneSharedModulesOnUninstall(extension); |
| 163 } | 166 } |
| 164 | 167 |
| 165 void SharedModuleService::OnShutdown() { | 168 void SharedModuleService::OnShutdown() { |
| 166 InstallTracker::Get(context_)->RemoveObserver(this); | 169 InstallTracker::Get(context_)->RemoveObserver(this); |
| 167 observing_ = false; | 170 observing_ = false; |
| 168 } | 171 } |
| 169 | 172 |
| 170 } // namespace extensions | 173 } // namespace extensions |
| OLD | NEW |