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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 // Providing GCM service, via GCMDriver, to a profile. | 29 // Providing GCM service, via GCMDriver, to a profile. |
30 class GCMProfileService : public KeyedService { | 30 class GCMProfileService : public KeyedService { |
31 public: | 31 public: |
32 // Returns whether GCM is enabled for |profile|. | 32 // Returns whether GCM is enabled for |profile|. |
33 static bool IsGCMEnabled(Profile* profile); | 33 static bool IsGCMEnabled(Profile* profile); |
34 | 34 |
35 // Register profile-specific prefs for GCM. | 35 // Register profile-specific prefs for GCM. |
36 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 36 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
37 | 37 |
| 38 #if defined(OS_ANDROID) |
| 39 explicit GCMProfileService(Profile* profile); |
| 40 #else |
38 GCMProfileService(Profile* profile, | 41 GCMProfileService(Profile* profile, |
39 scoped_ptr<GCMClientFactory> gcm_client_factory); | 42 scoped_ptr<GCMClientFactory> gcm_client_factory); |
| 43 #endif |
40 virtual ~GCMProfileService(); | 44 virtual ~GCMProfileService(); |
41 | 45 |
42 // TODO(jianli): obsolete methods that are going to be removed soon. | 46 // TODO(jianli): obsolete methods that are going to be removed soon. |
43 void AddAppHandler(const std::string& app_id, GCMAppHandler* handler); | 47 void AddAppHandler(const std::string& app_id, GCMAppHandler* handler); |
44 void RemoveAppHandler(const std::string& app_id); | 48 void RemoveAppHandler(const std::string& app_id); |
45 void Register(const std::string& app_id, | 49 void Register(const std::string& app_id, |
46 const std::vector<std::string>& sender_ids, | 50 const std::vector<std::string>& sender_ids, |
47 const GCMDriver::RegisterCallback& callback); | 51 const GCMDriver::RegisterCallback& callback); |
48 | 52 |
49 // KeyedService: | 53 // KeyedService: |
(...skipping 13 matching lines...) Expand all Loading... |
63 Profile* profile_; | 67 Profile* profile_; |
64 | 68 |
65 scoped_ptr<GCMDriver> driver_; | 69 scoped_ptr<GCMDriver> driver_; |
66 | 70 |
67 DISALLOW_COPY_AND_ASSIGN(GCMProfileService); | 71 DISALLOW_COPY_AND_ASSIGN(GCMProfileService); |
68 }; | 72 }; |
69 | 73 |
70 } // namespace gcm | 74 } // namespace gcm |
71 | 75 |
72 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ | 76 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ |
OLD | NEW |