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