OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/services/gcm/push_messaging_permission_context_factory.
h" | 5 #include "chrome/browser/push_messaging/push_messaging_permission_context_factor
y.h" |
6 | 6 |
7 #include "chrome/browser/profiles/incognito_helpers.h" | 7 #include "chrome/browser/profiles/incognito_helpers.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/services/gcm/push_messaging_permission_context.h" | 9 #include "chrome/browser/push_messaging/push_messaging_permission_context.h" |
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
11 | 11 |
12 namespace gcm { | |
13 | |
14 // static | 12 // static |
15 PushMessagingPermissionContext* | 13 PushMessagingPermissionContext* |
16 PushMessagingPermissionContextFactory::GetForProfile( | 14 PushMessagingPermissionContextFactory::GetForProfile( |
17 Profile* profile) { | 15 Profile* profile) { |
18 return static_cast<PushMessagingPermissionContext*>( | 16 return static_cast<PushMessagingPermissionContext*>( |
19 GetInstance()->GetServiceForBrowserContext(profile, true)); | 17 GetInstance()->GetServiceForBrowserContext(profile, true)); |
20 } | 18 } |
21 | 19 |
22 // static | 20 // static |
23 PushMessagingPermissionContextFactory* | 21 PushMessagingPermissionContextFactory* |
(...skipping 14 matching lines...) Expand all Loading... |
38 KeyedService* PushMessagingPermissionContextFactory::BuildServiceInstanceFor( | 36 KeyedService* PushMessagingPermissionContextFactory::BuildServiceInstanceFor( |
39 content::BrowserContext* profile) const { | 37 content::BrowserContext* profile) const { |
40 return new PushMessagingPermissionContext(static_cast<Profile*>(profile)); | 38 return new PushMessagingPermissionContext(static_cast<Profile*>(profile)); |
41 } | 39 } |
42 | 40 |
43 content::BrowserContext* | 41 content::BrowserContext* |
44 PushMessagingPermissionContextFactory::GetBrowserContextToUse( | 42 PushMessagingPermissionContextFactory::GetBrowserContextToUse( |
45 content::BrowserContext* context) const { | 43 content::BrowserContext* context) const { |
46 return chrome::GetBrowserContextOwnInstanceInIncognito(context); | 44 return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
47 } | 45 } |
48 | |
49 } // namespace gcm | |
OLD | NEW |