| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 explicit GCMProfileService(Profile* profile); | 72 explicit GCMProfileService(Profile* profile); |
| 73 virtual ~GCMProfileService(); | 73 virtual ~GCMProfileService(); |
| 74 | 74 |
| 75 void Initialize(scoped_ptr<GCMClientFactory> gcm_client_factory); | 75 void Initialize(scoped_ptr<GCMClientFactory> gcm_client_factory); |
| 76 | 76 |
| 77 void Start(); | 77 void Start(); |
| 78 | 78 |
| 79 void Stop(); | 79 void Stop(); |
| 80 | 80 |
| 81 // BrowserContextKeyedService implementation. |
| 82 virtual void Shutdown() OVERRIDE; |
| 83 |
| 81 // Registers |sender_id| for an app. A registration ID will be returned by | 84 // Registers |sender_id| for an app. A registration ID will be returned by |
| 82 // the GCM server. | 85 // the GCM server. |
| 83 // |app_id|: application ID. | 86 // |app_id|: application ID. |
| 84 // |sender_ids|: list of IDs of the servers that are allowed to send the | 87 // |sender_ids|: list of IDs of the servers that are allowed to send the |
| 85 // messages to the application. These IDs are assigned by the | 88 // messages to the application. These IDs are assigned by the |
| 86 // Google API Console. | 89 // Google API Console. |
| 87 // |callback|: to be called once the asynchronous operation is done. | 90 // |callback|: to be called once the asynchronous operation is done. |
| 88 virtual void Register(const std::string& app_id, | 91 virtual void Register(const std::string& app_id, |
| 89 const std::vector<std::string>& sender_ids, | 92 const std::vector<std::string>& sender_ids, |
| 90 RegisterCallback callback); | 93 RegisterCallback callback); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 228 |
| 226 // Used to pass a weak pointer to the IO worker. | 229 // Used to pass a weak pointer to the IO worker. |
| 227 base::WeakPtrFactory<GCMProfileService> weak_ptr_factory_; | 230 base::WeakPtrFactory<GCMProfileService> weak_ptr_factory_; |
| 228 | 231 |
| 229 DISALLOW_COPY_AND_ASSIGN(GCMProfileService); | 232 DISALLOW_COPY_AND_ASSIGN(GCMProfileService); |
| 230 }; | 233 }; |
| 231 | 234 |
| 232 } // namespace gcm | 235 } // namespace gcm |
| 233 | 236 |
| 234 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ | 237 #endif // CHROME_BROWSER_SERVICES_GCM_GCM_PROFILE_SERVICE_H_ |
| OLD | NEW |