| 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_DESKTOP_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ |
| 6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 const GCMClient::ChromeBuildInfo& chrome_build_info, | 50 const GCMClient::ChromeBuildInfo& chrome_build_info, |
| 51 PrefService* prefs, | 51 PrefService* prefs, |
| 52 const base::FilePath& store_path, | 52 const base::FilePath& store_path, |
| 53 const scoped_refptr<net::URLRequestContextGetter>& request_context, | 53 const scoped_refptr<net::URLRequestContextGetter>& request_context, |
| 54 const scoped_refptr<base::SequencedTaskRunner>& ui_thread, | 54 const scoped_refptr<base::SequencedTaskRunner>& ui_thread, |
| 55 const scoped_refptr<base::SequencedTaskRunner>& io_thread, | 55 const scoped_refptr<base::SequencedTaskRunner>& io_thread, |
| 56 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner); | 56 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner); |
| 57 virtual ~GCMDriverDesktop(); | 57 virtual ~GCMDriverDesktop(); |
| 58 | 58 |
| 59 // GCMDriver overrides: | 59 // GCMDriver overrides: |
| 60 virtual void Shutdown() OVERRIDE; | 60 virtual void Shutdown() override; |
| 61 virtual void OnSignedIn() OVERRIDE; | 61 virtual void OnSignedIn() override; |
| 62 virtual void Purge() OVERRIDE; | 62 virtual void Purge() override; |
| 63 virtual void AddAppHandler(const std::string& app_id, | 63 virtual void AddAppHandler(const std::string& app_id, |
| 64 GCMAppHandler* handler) OVERRIDE; | 64 GCMAppHandler* handler) override; |
| 65 virtual void RemoveAppHandler(const std::string& app_id) OVERRIDE; | 65 virtual void RemoveAppHandler(const std::string& app_id) override; |
| 66 virtual void AddConnectionObserver(GCMConnectionObserver* observer) OVERRIDE; | 66 virtual void AddConnectionObserver(GCMConnectionObserver* observer) override; |
| 67 virtual void RemoveConnectionObserver( | 67 virtual void RemoveConnectionObserver( |
| 68 GCMConnectionObserver* observer) OVERRIDE; | 68 GCMConnectionObserver* observer) override; |
| 69 virtual void Enable() OVERRIDE; | 69 virtual void Enable() override; |
| 70 virtual void Disable() OVERRIDE; | 70 virtual void Disable() override; |
| 71 virtual GCMClient* GetGCMClientForTesting() const OVERRIDE; | 71 virtual GCMClient* GetGCMClientForTesting() const override; |
| 72 virtual bool IsStarted() const OVERRIDE; | 72 virtual bool IsStarted() const override; |
| 73 virtual bool IsConnected() const OVERRIDE; | 73 virtual bool IsConnected() const override; |
| 74 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, | 74 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, |
| 75 bool clear_logs) OVERRIDE; | 75 bool clear_logs) override; |
| 76 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback, | 76 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback, |
| 77 bool recording) OVERRIDE; | 77 bool recording) override; |
| 78 virtual void SetAccountTokens( | 78 virtual void SetAccountTokens( |
| 79 const std::vector<GCMClient::AccountTokenInfo>& account_tokens) OVERRIDE; | 79 const std::vector<GCMClient::AccountTokenInfo>& account_tokens) override; |
| 80 virtual void UpdateAccountMapping( | 80 virtual void UpdateAccountMapping( |
| 81 const AccountMapping& account_mapping) OVERRIDE; | 81 const AccountMapping& account_mapping) override; |
| 82 virtual void RemoveAccountMapping(const std::string& account_id) OVERRIDE; | 82 virtual void RemoveAccountMapping(const std::string& account_id) override; |
| 83 | 83 |
| 84 // Exposed for testing purpose. | 84 // Exposed for testing purpose. |
| 85 bool gcm_enabled() const { return gcm_enabled_; } | 85 bool gcm_enabled() const { return gcm_enabled_; } |
| 86 GCMChannelStatusSyncer* gcm_channel_status_syncer_for_testing() { | 86 GCMChannelStatusSyncer* gcm_channel_status_syncer_for_testing() { |
| 87 return gcm_channel_status_syncer_.get(); | 87 return gcm_channel_status_syncer_.get(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 protected: | 90 protected: |
| 91 // GCMDriver implementation: | 91 // GCMDriver implementation: |
| 92 virtual GCMClient::Result EnsureStarted() OVERRIDE; | 92 virtual GCMClient::Result EnsureStarted() override; |
| 93 virtual void RegisterImpl( | 93 virtual void RegisterImpl( |
| 94 const std::string& app_id, | 94 const std::string& app_id, |
| 95 const std::vector<std::string>& sender_ids) OVERRIDE; | 95 const std::vector<std::string>& sender_ids) override; |
| 96 virtual void UnregisterImpl(const std::string& app_id) OVERRIDE; | 96 virtual void UnregisterImpl(const std::string& app_id) override; |
| 97 virtual void SendImpl(const std::string& app_id, | 97 virtual void SendImpl(const std::string& app_id, |
| 98 const std::string& receiver_id, | 98 const std::string& receiver_id, |
| 99 const GCMClient::OutgoingMessage& message) OVERRIDE; | 99 const GCMClient::OutgoingMessage& message) override; |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 class IOWorker; | 102 class IOWorker; |
| 103 | 103 |
| 104 // Stops the GCM service. It can be restarted by calling EnsureStarted again. | 104 // Stops the GCM service. It can be restarted by calling EnsureStarted again. |
| 105 void Stop(); | 105 void Stop(); |
| 106 | 106 |
| 107 // Remove cached data when GCM service is stopped. | 107 // Remove cached data when GCM service is stopped. |
| 108 void RemoveCachedData(); | 108 void RemoveCachedData(); |
| 109 | 109 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 // Used to pass a weak pointer to the IO worker. | 169 // Used to pass a weak pointer to the IO worker. |
| 170 base::WeakPtrFactory<GCMDriverDesktop> weak_ptr_factory_; | 170 base::WeakPtrFactory<GCMDriverDesktop> weak_ptr_factory_; |
| 171 | 171 |
| 172 DISALLOW_COPY_AND_ASSIGN(GCMDriverDesktop); | 172 DISALLOW_COPY_AND_ASSIGN(GCMDriverDesktop); |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 } // namespace gcm | 175 } // namespace gcm |
| 176 | 176 |
| 177 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ | 177 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ |
| OLD | NEW |