| 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 // This class listens for notifications from the Google Push notifications | 5 // This class listens for notifications from the Google Push notifications |
| 6 // service, and signals when they arrive. It checks all incoming stanzas to | 6 // service, and signals when they arrive. It checks all incoming stanzas to |
| 7 // see if they look like notifications, and filters out those which are not | 7 // see if they look like notifications, and filters out those which are not |
| 8 // valid. | 8 // valid. |
| 9 // | 9 // |
| 10 // The task is deleted automatically by the buzz::XmppClient. This occurs in the | 10 // The task is deleted automatically by the buzz::XmppClient. This occurs in the |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 protected: | 33 protected: |
| 34 virtual ~Delegate(); | 34 virtual ~Delegate(); |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 PushNotificationsListenTask(buzz::XmppTaskParentInterface* parent, | 37 PushNotificationsListenTask(buzz::XmppTaskParentInterface* parent, |
| 38 Delegate* delegate); | 38 Delegate* delegate); |
| 39 virtual ~PushNotificationsListenTask(); | 39 virtual ~PushNotificationsListenTask(); |
| 40 | 40 |
| 41 // Overriden from buzz::XmppTask. | 41 // Overriden from buzz::XmppTask. |
| 42 virtual int ProcessStart() OVERRIDE; | 42 virtual int ProcessStart() override; |
| 43 virtual int ProcessResponse() OVERRIDE; | 43 virtual int ProcessResponse() override; |
| 44 virtual bool HandleStanza(const buzz::XmlElement* stanza) OVERRIDE; | 44 virtual bool HandleStanza(const buzz::XmlElement* stanza) override; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 bool IsValidNotification(const buzz::XmlElement* stanza); | 47 bool IsValidNotification(const buzz::XmlElement* stanza); |
| 48 | 48 |
| 49 Delegate* delegate_; | 49 Delegate* delegate_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(PushNotificationsListenTask); | 51 DISALLOW_COPY_AND_ASSIGN(PushNotificationsListenTask); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 typedef PushNotificationsListenTask::Delegate | 54 typedef PushNotificationsListenTask::Delegate |
| 55 PushNotificationsListenTaskDelegate; | 55 PushNotificationsListenTaskDelegate; |
| 56 | 56 |
| 57 } // namespace notifier | 57 } // namespace notifier |
| 58 | 58 |
| 59 #endif // JINGLE_NOTIFIER_PUSH_NOTIFICATIONS_LISTENER_LISTEN_TASK_H_ | 59 #endif // JINGLE_NOTIFIER_PUSH_NOTIFICATIONS_LISTENER_LISTEN_TASK_H_ |
| OLD | NEW |