OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/push_messaging/push_messaging_service_factory.h" | 5 #include "chrome/browser/push_messaging/push_messaging_service_factory.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "chrome/browser/budget_service/background_budget_service_factory.h" | 9 #include "chrome/browser/budget_service/background_budget_service_factory.h" |
10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
11 #include "chrome/browser/permissions/permission_manager_factory.h" | 11 #include "chrome/browser/permissions/permission_manager_factory.h" |
12 #include "chrome/browser/profiles/incognito_helpers.h" | 12 #include "chrome/browser/profiles/incognito_helpers.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" | 14 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" |
15 #include "chrome/browser/services/gcm/fake_gcm_profile_service.h" | |
16 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" | 15 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
17 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 16 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
18 | 17 |
19 // static | 18 // static |
20 PushMessagingServiceImpl* PushMessagingServiceFactory::GetForProfile( | 19 PushMessagingServiceImpl* PushMessagingServiceFactory::GetForProfile( |
21 content::BrowserContext* profile) { | 20 content::BrowserContext* profile) { |
22 // The Push API is not currently supported in incognito mode. | 21 // The Push API is not currently supported in incognito mode. |
23 // See https://crbug.com/401439. | 22 // See https://crbug.com/401439. |
24 if (profile->IsOffTheRecord()) | 23 if (profile->IsOffTheRecord()) |
25 return NULL; | 24 return NULL; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 content::BrowserContext* context) const { | 56 content::BrowserContext* context) const { |
58 Profile* profile = Profile::FromBrowserContext(context); | 57 Profile* profile = Profile::FromBrowserContext(context); |
59 CHECK(!profile->IsOffTheRecord()); | 58 CHECK(!profile->IsOffTheRecord()); |
60 return new PushMessagingServiceImpl(profile); | 59 return new PushMessagingServiceImpl(profile); |
61 } | 60 } |
62 | 61 |
63 content::BrowserContext* PushMessagingServiceFactory::GetBrowserContextToUse( | 62 content::BrowserContext* PushMessagingServiceFactory::GetBrowserContextToUse( |
64 content::BrowserContext* context) const { | 63 content::BrowserContext* context) const { |
65 return chrome::GetBrowserContextOwnInstanceInIncognito(context); | 64 return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
66 } | 65 } |
OLD | NEW |