| 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 COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_ | 5 #ifndef COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_ |
| 6 #define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_ | 6 #define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 virtual void HandleMessages( | 41 virtual void HandleMessages( |
| 42 const std::string& app_id, | 42 const std::string& app_id, |
| 43 const std::string& subscription_id, | 43 const std::string& subscription_id, |
| 44 const std::vector<Message>& messages) = 0; | 44 const std::vector<Message>& messages) = 0; |
| 45 | 45 |
| 46 virtual void HandleStatusUpdate(CopresenceStatus status) = 0; | 46 virtual void HandleStatusUpdate(CopresenceStatus status) = 0; |
| 47 | 47 |
| 48 // Thw URLRequestContextGetter must outlive the CopresenceManager. | 48 // Thw URLRequestContextGetter must outlive the CopresenceManager. |
| 49 virtual net::URLRequestContextGetter* GetRequestContext() const = 0; | 49 virtual net::URLRequestContextGetter* GetRequestContext() const = 0; |
| 50 | 50 |
| 51 virtual const std::string GetPlatformVersionString() const = 0; | 51 virtual std::string GetPlatformVersionString() const = 0; |
| 52 | 52 |
| 53 virtual const std::string GetAPIKey(const std::string& app_id) const = 0; | 53 virtual std::string GetAPIKey(const std::string& app_id) const = 0; |
| 54 | 54 |
| 55 // The WhispernetClient must outlive the CopresenceManager. | 55 // The WhispernetClient must outlive the CopresenceManager. |
| 56 virtual audio_modem::WhispernetClient* GetWhispernetClient() = 0; | 56 virtual audio_modem::WhispernetClient* GetWhispernetClient() = 0; |
| 57 | 57 |
| 58 // Clients may optionally provide a GCMDriver to receive messages from. | 58 // Clients may optionally provide a GCMDriver to receive messages from. |
| 59 // If no driver is available, this can return null. | 59 // If no driver is available, this can return null. |
| 60 virtual gcm::GCMDriver* GetGCMDriver() = 0; | 60 virtual gcm::GCMDriver* GetGCMDriver() = 0; |
| 61 | 61 |
| 62 // Get the copresence device ID for authenticated or anonymous calls, | 62 // Get the copresence device ID for authenticated or anonymous calls, |
| 63 // as specified. If none exists, return the empty string. | 63 // as specified. If none exists, return the empty string. |
| 64 virtual const std::string GetDeviceId(bool authenticated) = 0; | 64 virtual std::string GetDeviceId(bool authenticated) = 0; |
| 65 | 65 |
| 66 // Save a copresence device ID for authenticated or anonymous calls. | 66 // Save a copresence device ID for authenticated or anonymous calls. |
| 67 // If the device ID is empty, any stored ID should be deleted. | 67 // If the device ID is empty, any stored ID should be deleted. |
| 68 virtual void SaveDeviceId(bool authenticated, | 68 virtual void SaveDeviceId(bool authenticated, |
| 69 const std::string& device_id) = 0; | 69 const std::string& device_id) = 0; |
| 70 | 70 |
| 71 protected: | 71 protected: |
| 72 virtual ~CopresenceDelegate() {} | 72 virtual ~CopresenceDelegate() {} |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace copresence | 75 } // namespace copresence |
| 76 | 76 |
| 77 #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_ | 77 #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_ |
| OLD | NEW |