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 #ifndef CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ |
6 #define CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ | 6 #define CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 // For testing purpose. | 49 // For testing purpose. |
50 class TestingDelegate { | 50 class TestingDelegate { |
51 public: | 51 public: |
52 virtual GCMEventRouter* GetEventRouter() const = 0; | 52 virtual GCMEventRouter* GetEventRouter() const = 0; |
53 virtual void CheckInFinished(const GCMClient::CheckinInfo& checkin_info, | 53 virtual void CheckInFinished(const GCMClient::CheckinInfo& checkin_info, |
54 GCMClient::Result result) = 0; | 54 GCMClient::Result result) = 0; |
55 }; | 55 }; |
56 | 56 |
57 // Returns true if the GCM support is enabled. | 57 // Returns true if the GCM support is enabled. |
58 static bool IsGCMEnabled(); | 58 static bool IsGCMEnabled(Profile* profile); |
59 | 59 |
60 // Register profile-specific prefs for GCM. | 60 // Register profile-specific prefs for GCM. |
61 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 61 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
62 | 62 |
63 explicit GCMProfileService(Profile* profile); | 63 explicit GCMProfileService(Profile* profile); |
64 // Constructor for testing purpose. | 64 // Constructor for testing purpose. |
65 GCMProfileService(Profile* profile, TestingDelegate* testing_delegate); | 65 GCMProfileService(Profile* profile, TestingDelegate* testing_delegate); |
66 virtual ~GCMProfileService(); | 66 virtual ~GCMProfileService(); |
67 | 67 |
68 // Registers |sender_id| for an app. A registration ID will be returned by | 68 // Registers |sender_id| for an app. A registration ID will be returned by |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 // Used to pass a weak pointer to the IO worker. | 206 // Used to pass a weak pointer to the IO worker. |
207 base::WeakPtrFactory<GCMProfileService> weak_ptr_factory_; | 207 base::WeakPtrFactory<GCMProfileService> weak_ptr_factory_; |
208 | 208 |
209 DISALLOW_COPY_AND_ASSIGN(GCMProfileService); | 209 DISALLOW_COPY_AND_ASSIGN(GCMProfileService); |
210 }; | 210 }; |
211 | 211 |
212 } // namespace gcm | 212 } // namespace gcm |
213 | 213 |
214 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ | 214 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ |
OLD | NEW |