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

Side by Side Diff: chrome/browser/custom_handlers/protocol_handler_registry_factory.cc

Issue 10546083: Convert ProtocolHandlerRegistry to be a ProfileKeyedService. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Respond to review comments. Fit and finish. Created 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
6
7 #include "base/memory/singleton.h"
8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
9 #include "chrome/browser/extensions/extension_system_factory.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/profiles/profile_dependency_manager.h"
12
13 // static
14 ProtocolHandlerRegistryFactory* ProtocolHandlerRegistryFactory::GetInstance() {
15 return Singleton<ProtocolHandlerRegistryFactory>::get();
16 }
17
18 // static
19 ProtocolHandlerRegistry* ProtocolHandlerRegistryFactory::GetForProfile(
20 Profile* profile) {
21 return static_cast<ProtocolHandlerRegistry*>(
22 GetInstance()->GetServiceForProfile(profile, true));
23 }
24
25 ProtocolHandlerRegistryFactory::ProtocolHandlerRegistryFactory()
26 : ProfileKeyedServiceFactory("ProtocolHandlerRegistry",
27 ProfileDependencyManager::GetInstance()) {
28
29 // DependsOn(WebIntentsRegistryFactory::GetInstance());
30 }
31
32 ProtocolHandlerRegistryFactory::~ProtocolHandlerRegistryFactory() {
33 }
34
35 ProfileKeyedService* ProtocolHandlerRegistryFactory::BuildServiceInstanceFor(
36 Profile* profile) const {
37
38 ProtocolHandlerRegistry* registry = new ProtocolHandlerRegistry(
39 profile, new ProtocolHandlerRegistry::Delegate());
40
41 registry->InitProtocolSettings();
42
43 return registry;
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698