| 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_GCM_DRIVER_GCM_ACCOUNT_MAPPER_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_ACCOUNT_MAPPER_H_ |
| 6 #define COMPONENTS_GCM_DRIVER_GCM_ACCOUNT_MAPPER_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_ACCOUNT_MAPPER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 virtual ~GCMAccountMapper(); | 33 virtual ~GCMAccountMapper(); |
| 34 | 34 |
| 35 void Initialize(const AccountMappings& account_mappings); | 35 void Initialize(const AccountMappings& account_mappings); |
| 36 | 36 |
| 37 // Called by AccountTracker, when a new list of account tokens is available. | 37 // Called by AccountTracker, when a new list of account tokens is available. |
| 38 // This will cause a refresh of account mappings and sending updates to GCM. | 38 // This will cause a refresh of account mappings and sending updates to GCM. |
| 39 void SetAccountTokens( | 39 void SetAccountTokens( |
| 40 const std::vector<GCMClient::AccountTokenInfo>& account_tokens); | 40 const std::vector<GCMClient::AccountTokenInfo>& account_tokens); |
| 41 | 41 |
| 42 // Implementation of GCMAppHandler: | 42 // Implementation of GCMAppHandler: |
| 43 virtual void ShutdownHandler() OVERRIDE; | 43 virtual void ShutdownHandler() override; |
| 44 virtual void OnMessage(const std::string& app_id, | 44 virtual void OnMessage(const std::string& app_id, |
| 45 const GCMClient::IncomingMessage& message) OVERRIDE; | 45 const GCMClient::IncomingMessage& message) override; |
| 46 virtual void OnMessagesDeleted(const std::string& app_id) OVERRIDE; | 46 virtual void OnMessagesDeleted(const std::string& app_id) override; |
| 47 virtual void OnSendError( | 47 virtual void OnSendError( |
| 48 const std::string& app_id, | 48 const std::string& app_id, |
| 49 const GCMClient::SendErrorDetails& send_error_details) OVERRIDE; | 49 const GCMClient::SendErrorDetails& send_error_details) override; |
| 50 virtual void OnSendAcknowledged(const std::string& app_id, | 50 virtual void OnSendAcknowledged(const std::string& app_id, |
| 51 const std::string& message_id) OVERRIDE; | 51 const std::string& message_id) override; |
| 52 virtual bool CanHandle(const std::string& app_id) const OVERRIDE; | 52 virtual bool CanHandle(const std::string& app_id) const override; |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 friend class GCMAccountMapperTest; | 55 friend class GCMAccountMapperTest; |
| 56 | 56 |
| 57 typedef std::map<std::string, GCMClient::OutgoingMessage> OutgoingMessages; | 57 typedef std::map<std::string, GCMClient::OutgoingMessage> OutgoingMessages; |
| 58 | 58 |
| 59 // Checks whether account mapper is ready to process new account tokens. | 59 // Checks whether account mapper is ready to process new account tokens. |
| 60 bool IsReady(); | 60 bool IsReady(); |
| 61 | 61 |
| 62 // Informs GCM of an added or refreshed account mapping. | 62 // Informs GCM of an added or refreshed account mapping. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 bool initialized_; | 115 bool initialized_; |
| 116 | 116 |
| 117 base::WeakPtrFactory<GCMAccountMapper> weak_ptr_factory_; | 117 base::WeakPtrFactory<GCMAccountMapper> weak_ptr_factory_; |
| 118 | 118 |
| 119 DISALLOW_COPY_AND_ASSIGN(GCMAccountMapper); | 119 DISALLOW_COPY_AND_ASSIGN(GCMAccountMapper); |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 } // namespace gcm | 122 } // namespace gcm |
| 123 | 123 |
| 124 #endif // COMPONENTS_GCM_DRIVER_GCM_ACCOUNT_MAPPER_H_ | 124 #endif // COMPONENTS_GCM_DRIVER_GCM_ACCOUNT_MAPPER_H_ |
| OLD | NEW |