| 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_DRIVER_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ |
| 6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 virtual void SetAccountTokens( | 126 virtual void SetAccountTokens( |
| 127 const std::vector<GCMClient::AccountTokenInfo>& account_tokens) = 0; | 127 const std::vector<GCMClient::AccountTokenInfo>& account_tokens) = 0; |
| 128 | 128 |
| 129 // Updates the |account_mapping| information in persistent store. | 129 // Updates the |account_mapping| information in persistent store. |
| 130 virtual void UpdateAccountMapping(const AccountMapping& account_mapping) = 0; | 130 virtual void UpdateAccountMapping(const AccountMapping& account_mapping) = 0; |
| 131 | 131 |
| 132 // Removes the account mapping information reated to |account_id| from | 132 // Removes the account mapping information reated to |account_id| from |
| 133 // persistent store. | 133 // persistent store. |
| 134 virtual void RemoveAccountMapping(const std::string& account_id) = 0; | 134 virtual void RemoveAccountMapping(const std::string& account_id) = 0; |
| 135 | 135 |
| 136 // Getter and setter of last token fetch time. |
| 137 virtual base::Time GetLastTokenFetchTime() = 0; |
| 138 virtual void SetLastTokenFetchTime(const base::Time& time) = 0; |
| 139 |
| 136 protected: | 140 protected: |
| 137 // Ensures that the GCM service starts (if necessary conditions are met). | 141 // Ensures that the GCM service starts (if necessary conditions are met). |
| 138 virtual GCMClient::Result EnsureStarted() = 0; | 142 virtual GCMClient::Result EnsureStarted() = 0; |
| 139 | 143 |
| 140 // Platform-specific implementation of Register. | 144 // Platform-specific implementation of Register. |
| 141 virtual void RegisterImpl(const std::string& app_id, | 145 virtual void RegisterImpl(const std::string& app_id, |
| 142 const std::vector<std::string>& sender_ids) = 0; | 146 const std::vector<std::string>& sender_ids) = 0; |
| 143 | 147 |
| 144 // Platform-specific implementation of Unregister. | 148 // Platform-specific implementation of Unregister. |
| 145 virtual void UnregisterImpl(const std::string& app_id) = 0; | 149 virtual void UnregisterImpl(const std::string& app_id) = 0; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 191 |
| 188 // The default handler when no app handler can be found in the map. | 192 // The default handler when no app handler can be found in the map. |
| 189 DefaultGCMAppHandler default_app_handler_; | 193 DefaultGCMAppHandler default_app_handler_; |
| 190 | 194 |
| 191 DISALLOW_COPY_AND_ASSIGN(GCMDriver); | 195 DISALLOW_COPY_AND_ASSIGN(GCMDriver); |
| 192 }; | 196 }; |
| 193 | 197 |
| 194 } // namespace gcm | 198 } // namespace gcm |
| 195 | 199 |
| 196 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ | 200 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_ |
| OLD | NEW |