Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: extensions/browser/extension_registry.cc

Issue 120863003: Convert ExtensionRegistry to a BrowserContextKeyedService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698