| [email protected] | e4097c8 | 2013-11-08 00:16:12 | [diff] [blame] | 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 | ||||
| 3 | // found in the LICENSE file. | ||||
| 4 | |||||
| 5 | #ifndef GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ | ||||
| 6 | #define GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ | ||||
| 7 | |||||
| 8 | #include "base/compiler_specific.h" | ||||
| [email protected] | 79994f4 | 2014-01-16 16:05:36 | [diff] [blame] | 9 | #include "base/memory/ref_counted.h" |
| 10 | #include "base/memory/scoped_ptr.h" | ||||
| [email protected] | e4097c8 | 2013-11-08 00:16:12 | [diff] [blame] | 11 | #include "google_apis/gcm/gcm_client.h" |
| 12 | |||||
| [email protected] | 79994f4 | 2014-01-16 16:05:36 | [diff] [blame] | 13 | namespace base { |
| 14 | class FilePath; | ||||
| 15 | class SequencedTaskRunner; | ||||
| 16 | } // namespace base | ||||
| 17 | |||||
| [email protected] | e4097c8 | 2013-11-08 00:16:12 | [diff] [blame] | 18 | namespace gcm { |
| 19 | |||||
| [email protected] | 79994f4 | 2014-01-16 16:05:36 | [diff] [blame] | 20 | class GCMStore; |
| 21 | class UserList; | ||||
| 22 | |||||
| [email protected] | 0db11822 | 2014-01-22 01:37:59 | [diff] [blame^] | 23 | class GCM_EXPORT GCMClientImpl : public GCMClient { |
| [email protected] | e4097c8 | 2013-11-08 00:16:12 | [diff] [blame] | 24 | public: |
| 25 | GCMClientImpl(); | ||||
| 26 | virtual ~GCMClientImpl(); | ||||
| 27 | |||||
| [email protected] | 79994f4 | 2014-01-16 16:05:36 | [diff] [blame] | 28 | void Initialize( |
| 29 | const base::FilePath& path, | ||||
| 30 | scoped_refptr<base::SequencedTaskRunner> blocking_task_runner); | ||||
| 31 | |||||
| [email protected] | e4097c8 | 2013-11-08 00:16:12 | [diff] [blame] | 32 | // Overridden from GCMClient: |
| [email protected] | 1b1c3cdc | 2013-12-17 18:40:04 | [diff] [blame] | 33 | virtual void SetUserDelegate(const std::string& username, |
| 34 | Delegate* delegate) OVERRIDE; | ||||
| 35 | virtual void CheckIn(const std::string& username) OVERRIDE; | ||||
| [email protected] | e4097c8 | 2013-11-08 00:16:12 | [diff] [blame] | 36 | virtual void Register(const std::string& username, |
| 37 | const std::string& app_id, | ||||
| 38 | const std::string& cert, | ||||
| 39 | const std::vector<std::string>& sender_ids) OVERRIDE; | ||||
| 40 | virtual void Unregister(const std::string& username, | ||||
| 41 | const std::string& app_id) OVERRIDE; | ||||
| 42 | virtual void Send(const std::string& username, | ||||
| 43 | const std::string& app_id, | ||||
| 44 | const std::string& receiver_id, | ||||
| 45 | const OutgoingMessage& message) OVERRIDE; | ||||
| 46 | virtual bool IsLoading() const OVERRIDE; | ||||
| 47 | |||||
| 48 | private: | ||||
| [email protected] | 79994f4 | 2014-01-16 16:05:36 | [diff] [blame] | 49 | scoped_ptr<GCMStore> gcm_store_; |
| 50 | scoped_ptr<UserList> user_list_; | ||||
| 51 | |||||
| [email protected] | e4097c8 | 2013-11-08 00:16:12 | [diff] [blame] | 52 | DISALLOW_COPY_AND_ASSIGN(GCMClientImpl); |
| 53 | }; | ||||
| 54 | |||||
| 55 | } // namespace gcm | ||||
| 56 | |||||
| 57 | #endif // GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ | ||||