| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SYNC_NOTIFIER_GCM_NETWORK_CHANNEL_DELEGATE_H_ | 5 #ifndef SYNC_NOTIFIER_GCM_NETWORK_CHANNEL_DELEGATE_H_ |
| 6 #define SYNC_NOTIFIER_GCM_NETWORK_CHANNEL_DELEGATE_H_ | 6 #define SYNC_NOTIFIER_GCM_NETWORK_CHANNEL_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "google_apis/gcm/gcm_client.h" | 11 #include "components/gcm_driver/gcm_client.h" |
| 12 | 12 |
| 13 class GoogleServiceAuthError; | 13 class GoogleServiceAuthError; |
| 14 | 14 |
| 15 namespace syncer { | 15 namespace syncer { |
| 16 | 16 |
| 17 // Delegate for GCMNetworkChannel. | 17 // Delegate for GCMNetworkChannel. |
| 18 // GCMNetworkChannel needs Register to register with GCM client and obtain gcm | 18 // GCMNetworkChannel needs Register to register with GCM client and obtain gcm |
| 19 // registration id. This id is used for building URL to cache invalidation | 19 // registration id. This id is used for building URL to cache invalidation |
| 20 // endpoint. | 20 // endpoint. |
| 21 // It needs RequestToken and InvalidateToken to get access token to include it | 21 // It needs RequestToken and InvalidateToken to get access token to include it |
| (...skipping 20 matching lines...) Expand all Loading... |
| 42 | 42 |
| 43 // Request registration_id from GCMService. Callback should be called with | 43 // Request registration_id from GCMService. Callback should be called with |
| 44 // either registration id or error code. | 44 // either registration id or error code. |
| 45 virtual void Register(RegisterCallback callback) = 0; | 45 virtual void Register(RegisterCallback callback) = 0; |
| 46 // Provide callback for incoming messages from GCM. | 46 // Provide callback for incoming messages from GCM. |
| 47 virtual void SetMessageReceiver(MessageCallback callback) = 0; | 47 virtual void SetMessageReceiver(MessageCallback callback) = 0; |
| 48 }; | 48 }; |
| 49 } // namespace syncer | 49 } // namespace syncer |
| 50 | 50 |
| 51 #endif // SYNC_NOTIFIER_GCM_NETWORK_CHANNEL_DELEGATE_H_ | 51 #endif // SYNC_NOTIFIER_GCM_NETWORK_CHANNEL_DELEGATE_H_ |
| OLD | NEW |