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 24 matching lines...) Expand all Loading... |
35 | 35 |
36 // Register profile-specific prefs for GCM. | 36 // Register profile-specific prefs for GCM. |
37 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 37 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
38 | 38 |
39 #if defined(OS_ANDROID) | 39 #if defined(OS_ANDROID) |
40 explicit GCMProfileService(Profile* profile); | 40 explicit GCMProfileService(Profile* profile); |
41 #else | 41 #else |
42 GCMProfileService(Profile* profile, | 42 GCMProfileService(Profile* profile, |
43 scoped_ptr<GCMClientFactory> gcm_client_factory); | 43 scoped_ptr<GCMClientFactory> gcm_client_factory); |
44 #endif | 44 #endif |
45 virtual ~GCMProfileService(); | 45 ~GCMProfileService() override; |
46 | 46 |
47 // TODO(jianli): obsolete methods that are going to be removed soon. | 47 // TODO(jianli): obsolete methods that are going to be removed soon. |
48 void AddAppHandler(const std::string& app_id, GCMAppHandler* handler); | 48 void AddAppHandler(const std::string& app_id, GCMAppHandler* handler); |
49 void RemoveAppHandler(const std::string& app_id); | 49 void RemoveAppHandler(const std::string& app_id); |
50 void Register(const std::string& app_id, | 50 void Register(const std::string& app_id, |
51 const std::vector<std::string>& sender_ids, | 51 const std::vector<std::string>& sender_ids, |
52 const GCMDriver::RegisterCallback& callback); | 52 const GCMDriver::RegisterCallback& callback); |
53 | 53 |
54 // KeyedService: | 54 // KeyedService: |
55 virtual void Shutdown() override; | 55 void Shutdown() override; |
56 | 56 |
57 // Returns the user name if the profile is signed in or an empty string | 57 // Returns the user name if the profile is signed in or an empty string |
58 // otherwise. | 58 // otherwise. |
59 // TODO(jianli): To be removed when sign-in enforcement is dropped. | 59 // TODO(jianli): To be removed when sign-in enforcement is dropped. |
60 std::string SignedInUserName() const; | 60 std::string SignedInUserName() const; |
61 | 61 |
62 // For testing purpose. | 62 // For testing purpose. |
63 void SetDriverForTesting(GCMDriver* driver); | 63 void SetDriverForTesting(GCMDriver* driver); |
64 | 64 |
65 GCMDriver* driver() const { return driver_.get(); } | 65 GCMDriver* driver() const { return driver_.get(); } |
(...skipping 23 matching lines...) Expand all Loading... |
89 #if defined(OS_CHROMEOS) | 89 #if defined(OS_CHROMEOS) |
90 scoped_ptr<GCMConnectionObserver> chromeos_connection_observer_; | 90 scoped_ptr<GCMConnectionObserver> chromeos_connection_observer_; |
91 #endif | 91 #endif |
92 | 92 |
93 DISALLOW_COPY_AND_ASSIGN(GCMProfileService); | 93 DISALLOW_COPY_AND_ASSIGN(GCMProfileService); |
94 }; | 94 }; |
95 | 95 |
96 } // namespace gcm | 96 } // namespace gcm |
97 | 97 |
98 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ | 98 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ |
OLD | NEW |