| 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/bind.h" | 10 #include "base/bind.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 for (ExtensionSet::const_iterator iter = set_to_check.begin(); | 125 for (ExtensionSet::const_iterator iter = set_to_check.begin(); |
| 126 iter != set_to_check.end(); | 126 iter != set_to_check.end(); |
| 127 ++iter) { | 127 ++iter) { |
| 128 if (SharedModuleInfo::ImportsExtensionById(iter->get(), | 128 if (SharedModuleInfo::ImportsExtensionById(iter->get(), |
| 129 extension->id())) { | 129 extension->id())) { |
| 130 dependents->Insert(*iter); | 130 dependents->Insert(*iter); |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 return dependents.Pass(); | 134 return dependents; |
| 135 } | 135 } |
| 136 | 136 |
| 137 void SharedModuleService::PruneSharedModules() { | 137 void SharedModuleService::PruneSharedModules() { |
| 138 ExtensionRegistry* registry = ExtensionRegistry::Get(browser_context_); | 138 ExtensionRegistry* registry = ExtensionRegistry::Get(browser_context_); |
| 139 ExtensionService* service = | 139 ExtensionService* service = |
| 140 ExtensionSystem::Get(browser_context_)->extension_service(); | 140 ExtensionSystem::Get(browser_context_)->extension_service(); |
| 141 | 141 |
| 142 ExtensionSet set_to_check; | 142 ExtensionSet set_to_check; |
| 143 set_to_check.InsertAll(registry->enabled_extensions()); | 143 set_to_check.InsertAll(registry->enabled_extensions()); |
| 144 set_to_check.InsertAll(registry->disabled_extensions()); | 144 set_to_check.InsertAll(registry->disabled_extensions()); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } | 184 } |
| 185 | 185 |
| 186 void SharedModuleService::OnExtensionUninstalled( | 186 void SharedModuleService::OnExtensionUninstalled( |
| 187 content::BrowserContext* browser_context, | 187 content::BrowserContext* browser_context, |
| 188 const Extension* extension, | 188 const Extension* extension, |
| 189 extensions::UninstallReason reason) { | 189 extensions::UninstallReason reason) { |
| 190 PruneSharedModules(); | 190 PruneSharedModules(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace extensions | 193 } // namespace extensions |
| OLD | NEW |