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

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

Issue 346193002: Use ExtensionRegistry in EventRouter and ApiResourceManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
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 "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "extensions/browser/extension_registry_factory.h" 8 #include "extensions/browser/extension_registry_factory.h"
9 #include "extensions/browser/extension_registry_observer.h" 9 #include "extensions/browser/extension_registry_observer.h"
10 10
(...skipping 12 matching lines...) Expand all
23 const { 23 const {
24 scoped_ptr<ExtensionSet> installed_extensions(new ExtensionSet); 24 scoped_ptr<ExtensionSet> installed_extensions(new ExtensionSet);
25 installed_extensions->InsertAll(enabled_extensions_); 25 installed_extensions->InsertAll(enabled_extensions_);
26 installed_extensions->InsertAll(disabled_extensions_); 26 installed_extensions->InsertAll(disabled_extensions_);
27 installed_extensions->InsertAll(terminated_extensions_); 27 installed_extensions->InsertAll(terminated_extensions_);
28 installed_extensions->InsertAll(blacklisted_extensions_); 28 installed_extensions->InsertAll(blacklisted_extensions_);
29 return installed_extensions.Pass(); 29 return installed_extensions.Pass();
30 } 30 }
31 31
32 void ExtensionRegistry::AddObserver(ExtensionRegistryObserver* observer) { 32 void ExtensionRegistry::AddObserver(ExtensionRegistryObserver* observer) {
33 DCHECK(observer);
33 observers_.AddObserver(observer); 34 observers_.AddObserver(observer);
34 } 35 }
35 36
36 void ExtensionRegistry::RemoveObserver(ExtensionRegistryObserver* observer) { 37 void ExtensionRegistry::RemoveObserver(ExtensionRegistryObserver* observer) {
37 observers_.RemoveObserver(observer); 38 observers_.RemoveObserver(observer);
38 } 39 }
39 40
40 void ExtensionRegistry::TriggerOnLoaded(const Extension* extension) { 41 void ExtensionRegistry::TriggerOnLoaded(const Extension* extension) {
41 DCHECK(enabled_extensions_.Contains(extension->id())); 42 DCHECK(enabled_extensions_.Contains(extension->id()));
42 FOR_EACH_OBSERVER(ExtensionRegistryObserver, 43 FOR_EACH_OBSERVER(ExtensionRegistryObserver,
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 disabled_extensions_.set_modification_callback(callback); 156 disabled_extensions_.set_modification_callback(callback);
156 } 157 }
157 158
158 void ExtensionRegistry::Shutdown() { 159 void ExtensionRegistry::Shutdown() {
159 // Release references to all Extension objects in the sets. 160 // Release references to all Extension objects in the sets.
160 ClearAll(); 161 ClearAll();
161 FOR_EACH_OBSERVER(ExtensionRegistryObserver, observers_, OnShutdown(this)); 162 FOR_EACH_OBSERVER(ExtensionRegistryObserver, observers_, OnShutdown(this));
162 } 163 }
163 164
164 } // namespace extensions 165 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698