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_FAKE_GCM_DRIVER_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_FAKE_GCM_DRIVER_H_ |
6 #define COMPONENTS_GCM_DRIVER_FAKE_GCM_DRIVER_H_ | 6 #define COMPONENTS_GCM_DRIVER_FAKE_GCM_DRIVER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "components/gcm_driver/gcm_driver.h" | 10 #include "components/gcm_driver/gcm_driver.h" |
11 | 11 |
12 namespace gcm { | 12 namespace gcm { |
13 | 13 |
14 class FakeGCMDriver : public GCMDriver { | 14 class FakeGCMDriver : public GCMDriver { |
15 public: | 15 public: |
16 FakeGCMDriver(); | 16 FakeGCMDriver(); |
17 virtual ~FakeGCMDriver(); | 17 virtual ~FakeGCMDriver(); |
18 | 18 |
19 // GCMDriver overrides: | 19 // GCMDriver overrides: |
20 virtual void Shutdown() OVERRIDE; | 20 virtual void Shutdown() override; |
21 virtual void AddAppHandler(const std::string& app_id, | 21 virtual void AddAppHandler(const std::string& app_id, |
22 GCMAppHandler* handler) OVERRIDE; | 22 GCMAppHandler* handler) override; |
23 virtual void RemoveAppHandler(const std::string& app_id) OVERRIDE; | 23 virtual void RemoveAppHandler(const std::string& app_id) override; |
24 virtual void OnSignedIn() OVERRIDE; | 24 virtual void OnSignedIn() override; |
25 virtual void Purge() OVERRIDE; | 25 virtual void Purge() override; |
26 virtual void AddConnectionObserver(GCMConnectionObserver* observer) OVERRIDE; | 26 virtual void AddConnectionObserver(GCMConnectionObserver* observer) override; |
27 virtual void RemoveConnectionObserver( | 27 virtual void RemoveConnectionObserver( |
28 GCMConnectionObserver* observer) OVERRIDE; | 28 GCMConnectionObserver* observer) override; |
29 virtual void Enable() OVERRIDE; | 29 virtual void Enable() override; |
30 virtual void Disable() OVERRIDE; | 30 virtual void Disable() override; |
31 virtual GCMClient* GetGCMClientForTesting() const OVERRIDE; | 31 virtual GCMClient* GetGCMClientForTesting() const override; |
32 virtual bool IsStarted() const OVERRIDE; | 32 virtual bool IsStarted() const override; |
33 virtual bool IsConnected() const OVERRIDE; | 33 virtual bool IsConnected() const override; |
34 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, | 34 virtual void GetGCMStatistics(const GetGCMStatisticsCallback& callback, |
35 bool clear_logs) OVERRIDE; | 35 bool clear_logs) override; |
36 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback, | 36 virtual void SetGCMRecording(const GetGCMStatisticsCallback& callback, |
37 bool recording) OVERRIDE; | 37 bool recording) override; |
38 virtual void SetAccountTokens( | 38 virtual void SetAccountTokens( |
39 const std::vector<GCMClient::AccountTokenInfo>& account_tokens) OVERRIDE; | 39 const std::vector<GCMClient::AccountTokenInfo>& account_tokens) override; |
40 virtual void UpdateAccountMapping( | 40 virtual void UpdateAccountMapping( |
41 const AccountMapping& account_mapping) OVERRIDE; | 41 const AccountMapping& account_mapping) override; |
42 virtual void RemoveAccountMapping(const std::string& account_id) OVERRIDE; | 42 virtual void RemoveAccountMapping(const std::string& account_id) override; |
43 | 43 |
44 protected: | 44 protected: |
45 // GCMDriver implementation: | 45 // GCMDriver implementation: |
46 virtual GCMClient::Result EnsureStarted() OVERRIDE; | 46 virtual GCMClient::Result EnsureStarted() override; |
47 virtual void RegisterImpl( | 47 virtual void RegisterImpl( |
48 const std::string& app_id, | 48 const std::string& app_id, |
49 const std::vector<std::string>& sender_ids) OVERRIDE; | 49 const std::vector<std::string>& sender_ids) override; |
50 virtual void UnregisterImpl(const std::string& app_id) OVERRIDE; | 50 virtual void UnregisterImpl(const std::string& app_id) override; |
51 virtual void SendImpl(const std::string& app_id, | 51 virtual void SendImpl(const std::string& app_id, |
52 const std::string& receiver_id, | 52 const std::string& receiver_id, |
53 const GCMClient::OutgoingMessage& message) OVERRIDE; | 53 const GCMClient::OutgoingMessage& message) override; |
54 | 54 |
55 private: | 55 private: |
56 DISALLOW_COPY_AND_ASSIGN(FakeGCMDriver); | 56 DISALLOW_COPY_AND_ASSIGN(FakeGCMDriver); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace gcm | 59 } // namespace gcm |
60 | 60 |
61 #endif // COMPONENTS_GCM_DRIVER_FAKE_GCM_DRIVER_H_ | 61 #endif // COMPONENTS_GCM_DRIVER_FAKE_GCM_DRIVER_H_ |
OLD | NEW |