| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 GOOGLE_APIS_GCM_GCM_CLIENT_H_ | 5 #ifndef GOOGLE_APIS_GCM_GCM_CLIENT_H_ |
| 6 #define GOOGLE_APIS_GCM_GCM_CLIENT_H_ | 6 #define GOOGLE_APIS_GCM_GCM_CLIENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 virtual void Load() = 0; | 156 virtual void Load() = 0; |
| 157 | 157 |
| 158 // Checks out of the GCM service. This will erase all the cached and persisted | 158 // Checks out of the GCM service. This will erase all the cached and persisted |
| 159 // data. | 159 // data. |
| 160 virtual void CheckOut() = 0; | 160 virtual void CheckOut() = 0; |
| 161 | 161 |
| 162 // Registers the application for GCM. Delegate::OnRegisterFinished will be | 162 // Registers the application for GCM. Delegate::OnRegisterFinished will be |
| 163 // called asynchronously upon completion. | 163 // called asynchronously upon completion. |
| 164 // |app_id|: application ID. | 164 // |app_id|: application ID. |
| 165 // |cert|: SHA-1 of public key of the application, in base16 format. | 165 // |cert|: SHA-1 of public key of the application, in base16 format. |
| 166 // |sender_ids|: list of IDs of the servers that are allowed to send the | 166 // |sender_id|: project ID of a server that is allowed to send messages to the |
| 167 // messages to the application. These IDs are assigned by the | 167 // application. Project IDs are assigned by the Google API |
| 168 // Google API Console. | 168 // Console. |
| 169 virtual void Register(const std::string& app_id, | 169 virtual void Register(const std::string& app_id, |
| 170 const std::string& cert, | 170 const std::string& cert, |
| 171 const std::vector<std::string>& sender_ids) = 0; | 171 const std::string& sender_id) = 0; |
| 172 | 172 |
| 173 // Unregisters the application from GCM when it is uninstalled. | 173 // Unregisters the application from GCM when it is uninstalled. |
| 174 // Delegate::OnUnregisterFinished will be called asynchronously upon | 174 // Delegate::OnUnregisterFinished will be called asynchronously upon |
| 175 // completion. | 175 // completion. |
| 176 // |app_id|: application ID. | 176 // |app_id|: application ID. |
| 177 virtual void Unregister(const std::string& app_id) = 0; | 177 virtual void Unregister(const std::string& app_id) = 0; |
| 178 | 178 |
| 179 // Sends a message to a given receiver. Delegate::OnSendFinished will be | 179 // Sends a message to a given receiver. Delegate::OnSendFinished will be |
| 180 // called asynchronously upon completion. | 180 // called asynchronously upon completion. |
| 181 // |app_id|: application ID. | 181 // |app_id|: application ID. |
| 182 // |receiver_id|: registration ID of the receiver party. | 182 // |receiver_id|: registration ID of the receiver party. |
| 183 // |message|: message to be sent. | 183 // |message|: message to be sent. |
| 184 virtual void Send(const std::string& app_id, | 184 virtual void Send(const std::string& app_id, |
| 185 const std::string& receiver_id, | 185 const std::string& receiver_id, |
| 186 const OutgoingMessage& message) = 0; | 186 const OutgoingMessage& message) = 0; |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 } // namespace gcm | 189 } // namespace gcm |
| 190 | 190 |
| 191 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_H_ | 191 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_H_ |
| OLD | NEW |