| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 JINGLE_NOTIFIER_LISTENER_FAKE_PUSH_CLIENT_H_ | 5 #ifndef JINGLE_NOTIFIER_LISTENER_FAKE_PUSH_CLIENT_H_ |
| 6 #define JINGLE_NOTIFIER_LISTENER_FAKE_PUSH_CLIENT_H_ | 6 #define JINGLE_NOTIFIER_LISTENER_FAKE_PUSH_CLIENT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "jingle/notifier/listener/push_client.h" | 13 #include "jingle/notifier/listener/push_client.h" |
| 14 #include "jingle/notifier/listener/push_client_observer.h" | 14 #include "jingle/notifier/listener/push_client_observer.h" |
| 15 | 15 |
| 16 namespace notifier { | 16 namespace notifier { |
| 17 | 17 |
| 18 // PushClient implementation that can be used for testing. | 18 // PushClient implementation that can be used for testing. |
| 19 class FakePushClient : public PushClient { | 19 class FakePushClient : public PushClient { |
| 20 public: | 20 public: |
| 21 FakePushClient(); | 21 FakePushClient(); |
| 22 virtual ~FakePushClient(); | 22 virtual ~FakePushClient(); |
| 23 | 23 |
| 24 // PushClient implementation. | 24 // PushClient implementation. |
| 25 virtual void AddObserver(PushClientObserver* observer) OVERRIDE; | 25 virtual void AddObserver(PushClientObserver* observer) override; |
| 26 virtual void RemoveObserver(PushClientObserver* observer) OVERRIDE; | 26 virtual void RemoveObserver(PushClientObserver* observer) override; |
| 27 virtual void UpdateSubscriptions( | 27 virtual void UpdateSubscriptions( |
| 28 const SubscriptionList& subscriptions) OVERRIDE; | 28 const SubscriptionList& subscriptions) override; |
| 29 virtual void UpdateCredentials( | 29 virtual void UpdateCredentials( |
| 30 const std::string& email, const std::string& token) OVERRIDE; | 30 const std::string& email, const std::string& token) override; |
| 31 virtual void SendNotification(const Notification& notification) OVERRIDE; | 31 virtual void SendNotification(const Notification& notification) override; |
| 32 virtual void SendPing() OVERRIDE; | 32 virtual void SendPing() override; |
| 33 | 33 |
| 34 // Triggers OnNotificationsEnabled on all observers. | 34 // Triggers OnNotificationsEnabled on all observers. |
| 35 void EnableNotifications(); | 35 void EnableNotifications(); |
| 36 | 36 |
| 37 // Triggers OnNotificationsDisabled on all observers. | 37 // Triggers OnNotificationsDisabled on all observers. |
| 38 void DisableNotifications(NotificationsDisabledReason reason); | 38 void DisableNotifications(NotificationsDisabledReason reason); |
| 39 | 39 |
| 40 // Triggers OnIncomingNotification on all observers. | 40 // Triggers OnIncomingNotification on all observers. |
| 41 void SimulateIncomingNotification(const Notification& notification); | 41 void SimulateIncomingNotification(const Notification& notification); |
| 42 | 42 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 53 std::string token_; | 53 std::string token_; |
| 54 std::vector<Notification> sent_notifications_; | 54 std::vector<Notification> sent_notifications_; |
| 55 int sent_pings_; | 55 int sent_pings_; |
| 56 | 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(FakePushClient); | 57 DISALLOW_COPY_AND_ASSIGN(FakePushClient); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 } // namespace notifier | 60 } // namespace notifier |
| 61 | 61 |
| 62 #endif // JINGLE_NOTIFIER_LISTENER_FAKE_PUSH_CLIENT_H_ | 62 #endif // JINGLE_NOTIFIER_LISTENER_FAKE_PUSH_CLIENT_H_ |
| OLD | NEW |