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/push_messaging/push_messaging_service_impl.h" | 5 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" |
6 | 6 |
7 #include <bitset> | 7 #include <bitset> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/barrier_closure.h" | 10 #include "base/barrier_closure.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 void UnregisterCallbackToClosure( | 89 void UnregisterCallbackToClosure( |
90 const base::Closure& closure, content::PushUnregistrationStatus status) { | 90 const base::Closure& closure, content::PushUnregistrationStatus status) { |
91 closure.Run(); | 91 closure.Run(); |
92 } | 92 } |
93 | 93 |
94 } // namespace | 94 } // namespace |
95 | 95 |
96 // static | 96 // static |
97 void PushMessagingServiceImpl::RegisterProfilePrefs( | 97 void PushMessagingServiceImpl::RegisterProfilePrefs( |
98 user_prefs::PrefRegistrySyncable* registry) { | 98 user_prefs::PrefRegistrySyncable* registry) { |
99 registry->RegisterIntegerPref( | 99 registry->RegisterIntegerPref(prefs::kPushMessagingRegistrationCount, 0); |
100 prefs::kPushMessagingRegistrationCount, | |
101 0, | |
102 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
103 PushMessagingApplicationId::RegisterProfilePrefs(registry); | 100 PushMessagingApplicationId::RegisterProfilePrefs(registry); |
104 } | 101 } |
105 | 102 |
106 // static | 103 // static |
107 void PushMessagingServiceImpl::InitializeForProfile(Profile* profile) { | 104 void PushMessagingServiceImpl::InitializeForProfile(Profile* profile) { |
108 // TODO(johnme): Consider whether push should be enabled in incognito. | 105 // TODO(johnme): Consider whether push should be enabled in incognito. |
109 if (!profile || profile->IsOffTheRecord()) | 106 if (!profile || profile->IsOffTheRecord()) |
110 return; | 107 return; |
111 | 108 |
112 // TODO(johnme): If push becomes enabled in incognito (and this still uses a | 109 // TODO(johnme): If push becomes enabled in incognito (and this still uses a |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 CONTENT_SETTING_ALLOW; | 817 CONTENT_SETTING_ALLOW; |
821 } | 818 } |
822 | 819 |
823 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { | 820 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { |
824 gcm::GCMProfileService* gcm_profile_service = | 821 gcm::GCMProfileService* gcm_profile_service = |
825 gcm::GCMProfileServiceFactory::GetForProfile(profile_); | 822 gcm::GCMProfileServiceFactory::GetForProfile(profile_); |
826 CHECK(gcm_profile_service); | 823 CHECK(gcm_profile_service); |
827 CHECK(gcm_profile_service->driver()); | 824 CHECK(gcm_profile_service->driver()); |
828 return gcm_profile_service->driver(); | 825 return gcm_profile_service->driver(); |
829 } | 826 } |
OLD | NEW |