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_XMPP_PUSH_CLIENT_H_ | 5 #ifndef JINGLE_NOTIFIER_LISTENER_XMPP_PUSH_CLIENT_H_ |
6 #define JINGLE_NOTIFIER_LISTENER_XMPP_PUSH_CLIENT_H_ | 6 #define JINGLE_NOTIFIER_LISTENER_XMPP_PUSH_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 public PushClient, | 37 public PushClient, |
38 public Login::Delegate, | 38 public Login::Delegate, |
39 public PushNotificationsListenTaskDelegate, | 39 public PushNotificationsListenTaskDelegate, |
40 public PushNotificationsSubscribeTaskDelegate, | 40 public PushNotificationsSubscribeTaskDelegate, |
41 public SendPingTaskDelegate { | 41 public SendPingTaskDelegate { |
42 public: | 42 public: |
43 explicit XmppPushClient(const NotifierOptions& notifier_options); | 43 explicit XmppPushClient(const NotifierOptions& notifier_options); |
44 virtual ~XmppPushClient(); | 44 virtual ~XmppPushClient(); |
45 | 45 |
46 // PushClient implementation. | 46 // PushClient implementation. |
47 virtual void AddObserver(PushClientObserver* observer) OVERRIDE; | 47 virtual void AddObserver(PushClientObserver* observer) override; |
48 virtual void RemoveObserver(PushClientObserver* observer) OVERRIDE; | 48 virtual void RemoveObserver(PushClientObserver* observer) override; |
49 virtual void UpdateSubscriptions( | 49 virtual void UpdateSubscriptions( |
50 const SubscriptionList& subscriptions) OVERRIDE; | 50 const SubscriptionList& subscriptions) override; |
51 virtual void UpdateCredentials( | 51 virtual void UpdateCredentials( |
52 const std::string& email, const std::string& token) OVERRIDE; | 52 const std::string& email, const std::string& token) override; |
53 virtual void SendNotification(const Notification& notification) OVERRIDE; | 53 virtual void SendNotification(const Notification& notification) override; |
54 virtual void SendPing() OVERRIDE; | 54 virtual void SendPing() override; |
55 | 55 |
56 // Login::Delegate implementation. | 56 // Login::Delegate implementation. |
57 virtual void OnConnect( | 57 virtual void OnConnect( |
58 base::WeakPtr<buzz::XmppTaskParentInterface> base_task) OVERRIDE; | 58 base::WeakPtr<buzz::XmppTaskParentInterface> base_task) override; |
59 virtual void OnTransientDisconnection() OVERRIDE; | 59 virtual void OnTransientDisconnection() override; |
60 virtual void OnCredentialsRejected() OVERRIDE; | 60 virtual void OnCredentialsRejected() override; |
61 | 61 |
62 // PushNotificationsListenTaskDelegate implementation. | 62 // PushNotificationsListenTaskDelegate implementation. |
63 virtual void OnNotificationReceived( | 63 virtual void OnNotificationReceived( |
64 const Notification& notification) OVERRIDE; | 64 const Notification& notification) override; |
65 | 65 |
66 // PushNotificationsSubscribeTaskDelegate implementation. | 66 // PushNotificationsSubscribeTaskDelegate implementation. |
67 virtual void OnSubscribed() OVERRIDE; | 67 virtual void OnSubscribed() override; |
68 virtual void OnSubscriptionError() OVERRIDE; | 68 virtual void OnSubscriptionError() override; |
69 | 69 |
70 // SendPingTaskDelegate implementation. | 70 // SendPingTaskDelegate implementation. |
71 virtual void OnPingResponseReceived() OVERRIDE; | 71 virtual void OnPingResponseReceived() override; |
72 | 72 |
73 private: | 73 private: |
74 base::ThreadChecker thread_checker_; | 74 base::ThreadChecker thread_checker_; |
75 const NotifierOptions notifier_options_; | 75 const NotifierOptions notifier_options_; |
76 ObserverList<PushClientObserver> observers_; | 76 ObserverList<PushClientObserver> observers_; |
77 | 77 |
78 // XMPP connection settings. | 78 // XMPP connection settings. |
79 SubscriptionList subscriptions_; | 79 SubscriptionList subscriptions_; |
80 buzz::XmppClientSettings xmpp_settings_; | 80 buzz::XmppClientSettings xmpp_settings_; |
81 | 81 |
82 scoped_ptr<notifier::Login> login_; | 82 scoped_ptr<notifier::Login> login_; |
83 | 83 |
84 // The XMPP connection. | 84 // The XMPP connection. |
85 base::WeakPtr<buzz::XmppTaskParentInterface> base_task_; | 85 base::WeakPtr<buzz::XmppTaskParentInterface> base_task_; |
86 | 86 |
87 std::vector<Notification> pending_notifications_to_send_; | 87 std::vector<Notification> pending_notifications_to_send_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(XmppPushClient); | 89 DISALLOW_COPY_AND_ASSIGN(XmppPushClient); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace notifier | 92 } // namespace notifier |
93 | 93 |
94 #endif // JINGLE_NOTIFIER_LISTENER_XMPP_PUSH_CLIENT_H_ | 94 #endif // JINGLE_NOTIFIER_LISTENER_XMPP_PUSH_CLIENT_H_ |
OLD | NEW |