| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ | 5 #ifndef GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ |
| 6 #define GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ | 6 #define GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 9 #include "google_apis/gcm/gcm_client.h" | 11 #include "google_apis/gcm/gcm_client.h" |
| 10 | 12 |
| 13 namespace base { |
| 14 class FilePath; |
| 15 class SequencedTaskRunner; |
| 16 } // namespace base |
| 17 |
| 11 namespace gcm { | 18 namespace gcm { |
| 12 | 19 |
| 20 class GCMStore; |
| 21 class UserList; |
| 22 |
| 13 class GCMClientImpl : public GCMClient { | 23 class GCMClientImpl : public GCMClient { |
| 14 public: | 24 public: |
| 15 GCMClientImpl(); | 25 GCMClientImpl(); |
| 16 virtual ~GCMClientImpl(); | 26 virtual ~GCMClientImpl(); |
| 17 | 27 |
| 28 void Initialize( |
| 29 const base::FilePath& path, |
| 30 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner); |
| 31 |
| 18 // Overridden from GCMClient: | 32 // Overridden from GCMClient: |
| 19 virtual void SetUserDelegate(const std::string& username, | 33 virtual void SetUserDelegate(const std::string& username, |
| 20 Delegate* delegate) OVERRIDE; | 34 Delegate* delegate) OVERRIDE; |
| 21 virtual void CheckIn(const std::string& username) OVERRIDE; | 35 virtual void CheckIn(const std::string& username) OVERRIDE; |
| 22 virtual void Register(const std::string& username, | 36 virtual void Register(const std::string& username, |
| 23 const std::string& app_id, | 37 const std::string& app_id, |
| 24 const std::string& cert, | 38 const std::string& cert, |
| 25 const std::vector<std::string>& sender_ids) OVERRIDE; | 39 const std::vector<std::string>& sender_ids) OVERRIDE; |
| 26 virtual void Unregister(const std::string& username, | 40 virtual void Unregister(const std::string& username, |
| 27 const std::string& app_id) OVERRIDE; | 41 const std::string& app_id) OVERRIDE; |
| 28 virtual void Send(const std::string& username, | 42 virtual void Send(const std::string& username, |
| 29 const std::string& app_id, | 43 const std::string& app_id, |
| 30 const std::string& receiver_id, | 44 const std::string& receiver_id, |
| 31 const OutgoingMessage& message) OVERRIDE; | 45 const OutgoingMessage& message) OVERRIDE; |
| 32 virtual bool IsLoading() const OVERRIDE; | 46 virtual bool IsLoading() const OVERRIDE; |
| 33 | 47 |
| 34 private: | 48 private: |
| 49 scoped_ptr<GCMStore> gcm_store_; |
| 50 scoped_ptr<UserList> user_list_; |
| 51 |
| 35 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl); | 52 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl); |
| 36 }; | 53 }; |
| 37 | 54 |
| 38 } // namespace gcm | 55 } // namespace gcm |
| 39 | 56 |
| 40 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ | 57 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ |
| OLD | NEW |