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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 for (ImportInfoVector::const_iterator iter = imports.begin(); | 146 for (ImportInfoVector::const_iterator iter = imports.begin(); |
147 iter != imports.end(); | 147 iter != imports.end(); |
148 ++iter) { | 148 ++iter) { |
149 const Extension* imported_module = | 149 const Extension* imported_module = |
150 registry->GetExtensionById(iter->extension_id, | 150 registry->GetExtensionById(iter->extension_id, |
151 ExtensionRegistry::EVERYTHING); | 151 ExtensionRegistry::EVERYTHING); |
152 if (imported_module && imported_module->from_webstore()) { | 152 if (imported_module && imported_module->from_webstore()) { |
153 scoped_ptr<const ExtensionSet> dependents = | 153 scoped_ptr<const ExtensionSet> dependents = |
154 GetDependentExtensions(imported_module); | 154 GetDependentExtensions(imported_module); |
155 if (dependents->is_empty()) { | 155 if (dependents->is_empty()) { |
156 service->UninstallExtension(iter->extension_id, | 156 service->UninstallExtension( |
157 true, // External uninstall. | 157 iter->extension_id, |
158 NULL); // Ignore error. | 158 ExtensionService::kUninstallReasonOrphanedSharedModule, |
| 159 NULL); // Ignore error. |
159 } | 160 } |
160 } | 161 } |
161 } | 162 } |
162 } | 163 } |
163 | 164 |
164 void SharedModuleService::OnExtensionUninstalled(const Extension* extension) { | 165 void SharedModuleService::OnExtensionUninstalled(const Extension* extension) { |
165 PruneSharedModulesOnUninstall(extension); | 166 PruneSharedModulesOnUninstall(extension); |
166 } | 167 } |
167 | 168 |
168 void SharedModuleService::OnShutdown() { | 169 void SharedModuleService::OnShutdown() { |
169 InstallTracker::Get(context_)->RemoveObserver(this); | 170 InstallTracker::Get(context_)->RemoveObserver(this); |
170 observing_ = false; | 171 observing_ = false; |
171 } | 172 } |
172 | 173 |
173 } // namespace extensions | 174 } // namespace extensions |
OLD | NEW |