| OLD | NEW |
| 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 "chrome/browser/extensions/api/declarative/rules_registry_service.h" | 5 #include "chrome/browser/extensions/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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 profile_, WebViewKey(0, 0), | 118 profile_, WebViewKey(0, 0), |
| 119 scoped_refptr<WebRequestRulesRegistry>(NULL))); | 119 scoped_refptr<WebRequestRulesRegistry>(NULL))); |
| 120 } | 120 } |
| 121 | 121 |
| 122 static base::LazyInstance<ProfileKeyedAPIFactory<RulesRegistryService> > | 122 static base::LazyInstance<ProfileKeyedAPIFactory<RulesRegistryService> > |
| 123 g_factory = LAZY_INSTANCE_INITIALIZER; | 123 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 124 | 124 |
| 125 // static | 125 // static |
| 126 ProfileKeyedAPIFactory<RulesRegistryService>* | 126 ProfileKeyedAPIFactory<RulesRegistryService>* |
| 127 RulesRegistryService::GetFactoryInstance() { | 127 RulesRegistryService::GetFactoryInstance() { |
| 128 return &g_factory.Get(); | 128 return g_factory.Pointer(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 // static | 131 // static |
| 132 RulesRegistryService* RulesRegistryService::Get(Profile* profile) { | 132 RulesRegistryService* RulesRegistryService::Get(Profile* profile) { |
| 133 return ProfileKeyedAPIFactory<RulesRegistryService>::GetForProfile(profile); | 133 return ProfileKeyedAPIFactory<RulesRegistryService>::GetForProfile(profile); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void RulesRegistryService::RegisterRulesRegistry( | 136 void RulesRegistryService::RegisterRulesRegistry( |
| 137 scoped_refptr<RulesRegistry> rule_registry) { | 137 scoped_refptr<RulesRegistry> rule_registry) { |
| 138 const std::string event_name(rule_registry->event_name()); | 138 const std::string event_name(rule_registry->event_name()); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 RemoveWebViewRulesRegistries(process->GetID()); | 234 RemoveWebViewRulesRegistries(process->GetID()); |
| 235 break; | 235 break; |
| 236 } | 236 } |
| 237 default: | 237 default: |
| 238 NOTREACHED(); | 238 NOTREACHED(); |
| 239 break; | 239 break; |
| 240 } | 240 } |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace extensions | 243 } // namespace extensions |
| OLD | NEW |