| 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 <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/version.h" | 10 #include "base/version.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 ExtensionRegistry::EVERYTHING); | 54 ExtensionRegistry::EVERYTHING); |
| 55 if (!imported_module) { | 55 if (!imported_module) { |
| 56 if (extension->from_webstore()) { | 56 if (extension->from_webstore()) { |
| 57 status = IMPORT_STATUS_UNSATISFIED; | 57 status = IMPORT_STATUS_UNSATISFIED; |
| 58 missing_modules->push_back(*iter); | 58 missing_modules->push_back(*iter); |
| 59 } else { | 59 } else { |
| 60 return IMPORT_STATUS_UNRECOVERABLE; | 60 return IMPORT_STATUS_UNRECOVERABLE; |
| 61 } | 61 } |
| 62 } else if (!SharedModuleInfo::IsSharedModule(imported_module)) { | 62 } else if (!SharedModuleInfo::IsSharedModule(imported_module)) { |
| 63 return IMPORT_STATUS_UNRECOVERABLE; | 63 return IMPORT_STATUS_UNRECOVERABLE; |
| 64 } else if (!SharedModuleInfo::IsExportAllowedByWhitelist(imported_module, | |
| 65 extension->id())) { | |
| 66 return IMPORT_STATUS_UNRECOVERABLE; | |
| 67 } else if (version_required.IsValid() && | 64 } else if (version_required.IsValid() && |
| 68 imported_module->version()->CompareTo(version_required) < 0) { | 65 imported_module->version()->CompareTo(version_required) < 0) { |
| 69 if (imported_module->from_webstore()) { | 66 if (imported_module->from_webstore()) { |
| 70 outdated_modules->push_back(*iter); | 67 outdated_modules->push_back(*iter); |
| 71 status = IMPORT_STATUS_UNSATISFIED; | 68 status = IMPORT_STATUS_UNSATISFIED; |
| 72 } else { | 69 } else { |
| 73 return IMPORT_STATUS_UNRECOVERABLE; | 70 return IMPORT_STATUS_UNRECOVERABLE; |
| 74 } | 71 } |
| 75 } | 72 } |
| 76 } | 73 } |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 179 } |
| 183 | 180 |
| 184 void SharedModuleService::OnExtensionUninstalled( | 181 void SharedModuleService::OnExtensionUninstalled( |
| 185 content::BrowserContext* browser_context, | 182 content::BrowserContext* browser_context, |
| 186 const Extension* extension, | 183 const Extension* extension, |
| 187 extensions::UninstallReason reason) { | 184 extensions::UninstallReason reason) { |
| 188 PruneSharedModules(); | 185 PruneSharedModules(); |
| 189 } | 186 } |
| 190 | 187 |
| 191 } // namespace extensions | 188 } // namespace extensions |
| OLD | NEW |