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

Side by Side Diff: extensions/browser/api/declarative/rules_registry_service.cc

Issue 1232603002: This patch improves the way that GuestViewManager tracks the destruction of GuestView embedders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment by kalman@. Created 5 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/api/declarative/rules_registry_service.h" 5 #include "extensions/browser/api/declarative/rules_registry_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 RulesRegistryService::GetFactoryInstance() { 130 RulesRegistryService::GetFactoryInstance() {
131 return g_factory.Pointer(); 131 return g_factory.Pointer();
132 } 132 }
133 133
134 // static 134 // static
135 RulesRegistryService* RulesRegistryService::Get( 135 RulesRegistryService* RulesRegistryService::Get(
136 content::BrowserContext* context) { 136 content::BrowserContext* context) {
137 return BrowserContextKeyedAPIFactory<RulesRegistryService>::Get(context); 137 return BrowserContextKeyedAPIFactory<RulesRegistryService>::Get(context);
138 } 138 }
139 139
140 // static
141 RulesRegistryService* RulesRegistryService::GetIfExists(
142 content::BrowserContext* context) {
143 return BrowserContextKeyedAPIFactory<RulesRegistryService>::GetIfExists(
144 context);
145 }
146
140 void RulesRegistryService::RegisterRulesRegistry( 147 void RulesRegistryService::RegisterRulesRegistry(
141 scoped_refptr<RulesRegistry> rule_registry) { 148 scoped_refptr<RulesRegistry> rule_registry) {
142 const std::string event_name(rule_registry->event_name()); 149 const std::string event_name(rule_registry->event_name());
143 RulesRegistryKey key(event_name, rule_registry->id()); 150 RulesRegistryKey key(event_name, rule_registry->id());
144 DCHECK(rule_registries_.find(key) == rule_registries_.end()); 151 DCHECK(rule_registries_.find(key) == rule_registries_.end());
145 rule_registries_[key] = rule_registry; 152 rule_registries_[key] = rule_registry;
146 } 153 }
147 154
148 scoped_refptr<RulesRegistry> RulesRegistryService::GetRulesRegistry( 155 scoped_refptr<RulesRegistry> RulesRegistryService::GetRulesRegistry(
149 int rules_registry_id, 156 int rules_registry_id,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 218 }
212 219
213 void RulesRegistryService::OnExtensionUninstalled( 220 void RulesRegistryService::OnExtensionUninstalled(
214 content::BrowserContext* browser_context, 221 content::BrowserContext* browser_context,
215 const Extension* extension, 222 const Extension* extension,
216 extensions::UninstallReason reason) { 223 extensions::UninstallReason reason) {
217 NotifyRegistriesHelper(&RulesRegistry::OnExtensionUninstalled, extension); 224 NotifyRegistriesHelper(&RulesRegistry::OnExtensionUninstalled, extension);
218 } 225 }
219 226
220 } // namespace extensions 227 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/declarative/rules_registry_service.h ('k') | extensions/browser/browser_context_keyed_api_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698