OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/chromeos/extensions/networking_private_event_router_fac
tory.h" | 5 #include "chrome/browser/chromeos/extensions/networking_private_event_router_fac
tory.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/extensions/networking_private_event_router.h" | 7 #include "chrome/browser/chromeos/extensions/networking_private_event_router.h" |
8 #include "chrome/browser/extensions/extension_system_factory.h" | 8 #include "chrome/browser/extensions/extension_system_factory.h" |
| 9 #include "chrome/browser/profiles/incognito_helpers.h" |
9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/profiles/profile_dependency_manager.h" | 11 #include "chrome/browser/profiles/profile_dependency_manager.h" |
11 | 12 |
12 namespace chromeos { | 13 namespace chromeos { |
13 | 14 |
14 // static | 15 // static |
15 NetworkingPrivateEventRouter* | 16 NetworkingPrivateEventRouter* |
16 NetworkingPrivateEventRouterFactory::GetForProfile(Profile* profile) { | 17 NetworkingPrivateEventRouterFactory::GetForProfile(Profile* profile) { |
17 return static_cast<NetworkingPrivateEventRouter*>( | 18 return static_cast<NetworkingPrivateEventRouter*>( |
18 GetInstance()->GetServiceForProfile(profile, true)); | 19 GetInstance()->GetServiceForProfile(profile, true)); |
(...skipping 14 matching lines...) Expand all Loading... |
33 | 34 |
34 NetworkingPrivateEventRouterFactory::~NetworkingPrivateEventRouterFactory() { | 35 NetworkingPrivateEventRouterFactory::~NetworkingPrivateEventRouterFactory() { |
35 } | 36 } |
36 | 37 |
37 ProfileKeyedService* | 38 ProfileKeyedService* |
38 NetworkingPrivateEventRouterFactory::BuildServiceInstanceFor( | 39 NetworkingPrivateEventRouterFactory::BuildServiceInstanceFor( |
39 content::BrowserContext* profile) const { | 40 content::BrowserContext* profile) const { |
40 return new NetworkingPrivateEventRouter(static_cast<Profile*>(profile)); | 41 return new NetworkingPrivateEventRouter(static_cast<Profile*>(profile)); |
41 } | 42 } |
42 | 43 |
43 bool | 44 content::BrowserContext* |
44 NetworkingPrivateEventRouterFactory::ServiceHasOwnInstanceInIncognito() const { | 45 NetworkingPrivateEventRouterFactory::GetBrowserContextToUse( |
45 return true; | 46 content::BrowserContext* context) const { |
| 47 return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
46 } | 48 } |
47 | 49 |
48 bool NetworkingPrivateEventRouterFactory::ServiceIsCreatedWithProfile() const { | 50 bool NetworkingPrivateEventRouterFactory::ServiceIsCreatedWithProfile() const { |
49 return true; | 51 return true; |
50 } | 52 } |
51 | 53 |
52 bool NetworkingPrivateEventRouterFactory::ServiceIsNULLWhileTesting() const { | 54 bool NetworkingPrivateEventRouterFactory::ServiceIsNULLWhileTesting() const { |
53 return true; | 55 return true; |
54 } | 56 } |
55 | 57 |
56 } // namespace chromeos | 58 } // namespace chromeos |
OLD | NEW |