| 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 // Methods for sending the update stanza to notify peers via xmpp. | 5 // Methods for sending the update stanza to notify peers via xmpp. |
| 6 | 6 |
| 7 #ifndef JINGLE_NOTIFIER_LISTENER_PUSH_NOTIFICATIONS_SEND_UPDATE_TASK_H_ | 7 #ifndef JINGLE_NOTIFIER_LISTENER_PUSH_NOTIFICATIONS_SEND_UPDATE_TASK_H_ |
| 8 #define JINGLE_NOTIFIER_LISTENER_PUSH_NOTIFICATIONS_SEND_UPDATE_TASK_H_ | 8 #define JINGLE_NOTIFIER_LISTENER_PUSH_NOTIFICATIONS_SEND_UPDATE_TASK_H_ |
| 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/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "jingle/notifier/listener/notification_defines.h" | 13 #include "jingle/notifier/listener/notification_defines.h" |
| 14 #include "talk/xmpp/xmpptask.h" | 14 #include "talk/xmpp/xmpptask.h" |
| 15 | 15 |
| 16 namespace buzz { | 16 namespace buzz { |
| 17 class Jid; | 17 class Jid; |
| 18 class XmlElement; | 18 class XmlElement; |
| 19 } // namespace | 19 } // namespace |
| 20 | 20 |
| 21 namespace notifier { | 21 namespace notifier { |
| 22 | 22 |
| 23 class PushNotificationsSendUpdateTask : public buzz::XmppTask { | 23 class PushNotificationsSendUpdateTask : public buzz::XmppTask { |
| 24 public: | 24 public: |
| 25 PushNotificationsSendUpdateTask( | 25 PushNotificationsSendUpdateTask( |
| 26 buzz::XmppTaskParentInterface* parent, const Notification& notification); | 26 buzz::XmppTaskParentInterface* parent, const Notification& notification); |
| 27 virtual ~PushNotificationsSendUpdateTask(); | 27 virtual ~PushNotificationsSendUpdateTask(); |
| 28 | 28 |
| 29 // Overridden from buzz::XmppTask. | 29 // Overridden from buzz::XmppTask. |
| 30 virtual int ProcessStart() OVERRIDE; | 30 virtual int ProcessStart() override; |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 // Allocates and constructs an buzz::XmlElement containing the update stanza. | 33 // Allocates and constructs an buzz::XmlElement containing the update stanza. |
| 34 static buzz::XmlElement* MakeUpdateMessage( | 34 static buzz::XmlElement* MakeUpdateMessage( |
| 35 const Notification& notification, const buzz::Jid& to_jid_bare); | 35 const Notification& notification, const buzz::Jid& to_jid_bare); |
| 36 | 36 |
| 37 const Notification notification_; | 37 const Notification notification_; |
| 38 | 38 |
| 39 FRIEND_TEST_ALL_PREFIXES(PushNotificationsSendUpdateTaskTest, | 39 FRIEND_TEST_ALL_PREFIXES(PushNotificationsSendUpdateTaskTest, |
| 40 MakeUpdateMessage); | 40 MakeUpdateMessage); |
| 41 | 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(PushNotificationsSendUpdateTask); | 42 DISALLOW_COPY_AND_ASSIGN(PushNotificationsSendUpdateTask); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace notifier | 45 } // namespace notifier |
| 46 | 46 |
| 47 #endif // JINGLE_NOTIFIER_LISTENER_PUSH_NOTIFICATIONS_SEND_UPDATE_TASK_H_ | 47 #endif // JINGLE_NOTIFIER_LISTENER_PUSH_NOTIFICATIONS_SEND_UPDATE_TASK_H_ |
| OLD | NEW |