OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This class handles subscribing to the new Google push notifications. | 5 // This class handles subscribing to the new Google push notifications. |
6 | 6 |
7 #ifndef JINGLE_NOTIFIER_LISTENER_PUSH_NOTIFICATIONS_SUBSCRIBE_TASK_H_ | 7 #ifndef JINGLE_NOTIFIER_LISTENER_PUSH_NOTIFICATIONS_SUBSCRIBE_TASK_H_ |
8 #define JINGLE_NOTIFIER_LISTENER_PUSH_NOTIFICATIONS_SUBSCRIBE_TASK_H_ | 8 #define JINGLE_NOTIFIER_LISTENER_PUSH_NOTIFICATIONS_SUBSCRIBE_TASK_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 14 matching lines...) Expand all Loading... |
25 virtual void OnSubscribed() = 0; | 25 virtual void OnSubscribed() = 0; |
26 virtual void OnSubscriptionError() = 0; | 26 virtual void OnSubscriptionError() = 0; |
27 }; | 27 }; |
28 | 28 |
29 PushNotificationsSubscribeTask(buzz::XmppTaskParentInterface* parent, | 29 PushNotificationsSubscribeTask(buzz::XmppTaskParentInterface* parent, |
30 const SubscriptionList& subscriptions, | 30 const SubscriptionList& subscriptions, |
31 Delegate* delegate); | 31 Delegate* delegate); |
32 virtual ~PushNotificationsSubscribeTask(); | 32 virtual ~PushNotificationsSubscribeTask(); |
33 | 33 |
34 // Overridden from XmppTask. | 34 // Overridden from XmppTask. |
35 virtual int ProcessStart() OVERRIDE; | 35 virtual int ProcessStart() override; |
36 virtual int ProcessResponse() OVERRIDE; | 36 virtual int ProcessResponse() override; |
37 virtual bool HandleStanza(const buzz::XmlElement* stanza) OVERRIDE; | 37 virtual bool HandleStanza(const buzz::XmlElement* stanza) override; |
38 | 38 |
39 private: | 39 private: |
40 // Assembles an Xmpp stanza which can be sent to subscribe to notifications. | 40 // Assembles an Xmpp stanza which can be sent to subscribe to notifications. |
41 static buzz::XmlElement* MakeSubscriptionMessage( | 41 static buzz::XmlElement* MakeSubscriptionMessage( |
42 const SubscriptionList& subscriptions, | 42 const SubscriptionList& subscriptions, |
43 const buzz::Jid& jid, const std::string& task_id); | 43 const buzz::Jid& jid, const std::string& task_id); |
44 | 44 |
45 SubscriptionList subscriptions_; | 45 SubscriptionList subscriptions_; |
46 Delegate* delegate_; | 46 Delegate* delegate_; |
47 | 47 |
48 FRIEND_TEST_ALL_PREFIXES(PushNotificationsSubscribeTaskTest, | 48 FRIEND_TEST_ALL_PREFIXES(PushNotificationsSubscribeTaskTest, |
49 MakeSubscriptionMessage); | 49 MakeSubscriptionMessage); |
50 | 50 |
51 DISALLOW_COPY_AND_ASSIGN(PushNotificationsSubscribeTask); | 51 DISALLOW_COPY_AND_ASSIGN(PushNotificationsSubscribeTask); |
52 }; | 52 }; |
53 | 53 |
54 typedef PushNotificationsSubscribeTask::Delegate | 54 typedef PushNotificationsSubscribeTask::Delegate |
55 PushNotificationsSubscribeTaskDelegate; | 55 PushNotificationsSubscribeTaskDelegate; |
56 | 56 |
57 | 57 |
58 } // namespace notifier | 58 } // namespace notifier |
59 | 59 |
60 #endif // JINGLE_NOTIFIER_LISTENER_PUSH_NOTIFICATIONS_SUBSCRIBE_TASK_H_ | 60 #endif // JINGLE_NOTIFIER_LISTENER_PUSH_NOTIFICATIONS_SUBSCRIBE_TASK_H_ |
OLD | NEW |