| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "extensions/browser/extension_registry.h" | 5 #include "extensions/browser/extension_registry.h" |
| 6 | 6 |
| 7 #include "extensions/browser/extension_registry_factory.h" |
| 8 |
| 7 namespace extensions { | 9 namespace extensions { |
| 8 | 10 |
| 9 ExtensionRegistry::ExtensionRegistry() {} | 11 ExtensionRegistry::ExtensionRegistry() {} |
| 10 ExtensionRegistry::~ExtensionRegistry() {} | 12 ExtensionRegistry::~ExtensionRegistry() {} |
| 11 | 13 |
| 14 // static |
| 15 ExtensionRegistry* ExtensionRegistry::Get(content::BrowserContext* context) { |
| 16 return ExtensionRegistryFactory::GetForBrowserContext(context); |
| 17 } |
| 18 |
| 12 bool ExtensionRegistry::AddEnabled( | 19 bool ExtensionRegistry::AddEnabled( |
| 13 const scoped_refptr<const Extension>& extension) { | 20 const scoped_refptr<const Extension>& extension) { |
| 14 return enabled_extensions_.Insert(extension); | 21 return enabled_extensions_.Insert(extension); |
| 15 } | 22 } |
| 16 | 23 |
| 17 bool ExtensionRegistry::RemoveEnabled(const std::string& id) { | 24 bool ExtensionRegistry::RemoveEnabled(const std::string& id) { |
| 18 return enabled_extensions_.Remove(id); | 25 return enabled_extensions_.Remove(id); |
| 19 } | 26 } |
| 20 | 27 |
| 21 bool ExtensionRegistry::AddDisabled( | 28 bool ExtensionRegistry::AddDisabled( |
| (...skipping 28 matching lines...) Expand all Loading... |
| 50 disabled_extensions_.Clear(); | 57 disabled_extensions_.Clear(); |
| 51 terminated_extensions_.Clear(); | 58 terminated_extensions_.Clear(); |
| 52 blacklisted_extensions_.Clear(); | 59 blacklisted_extensions_.Clear(); |
| 53 } | 60 } |
| 54 | 61 |
| 55 void ExtensionRegistry::SetDisabledModificationCallback( | 62 void ExtensionRegistry::SetDisabledModificationCallback( |
| 56 const ExtensionSet::ModificationCallback& callback) { | 63 const ExtensionSet::ModificationCallback& callback) { |
| 57 disabled_extensions_.set_modification_callback(callback); | 64 disabled_extensions_.set_modification_callback(callback); |
| 58 } | 65 } |
| 59 | 66 |
| 67 void ExtensionRegistry::Shutdown() { |
| 68 // Release references to all Extension objects in the sets. |
| 69 ClearAll(); |
| 70 } |
| 71 |
| 60 } // namespace extensions | 72 } // namespace extensions |
| OLD | NEW |