OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_HOST_GCD_NOTIFICATION_SUBSCRIBER_H_ |
| 6 #define REMOTING_HOST_GCD_NOTIFICATION_SUBSCRIBER_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "remoting/signaling/signal_strategy.h" |
| 13 |
| 14 namespace remoting { |
| 15 |
| 16 class IqSender; |
| 17 class IqRequest; |
| 18 |
| 19 // An object that subscribes to notifications from GCD using an XMPP |
| 20 // channel. No actual notifications are used, but the subscription is |
| 21 // necessary in order for GCD to consider a device online. |
| 22 class GcdNotificationSubscriber : public SignalStrategy::Listener { |
| 23 public: |
| 24 GcdNotificationSubscriber(SignalStrategy* signal_strategy); |
| 25 ~GcdNotificationSubscriber() override; |
| 26 |
| 27 private: |
| 28 // SignalStrategy::Listener interface. |
| 29 void OnSignalStrategyStateChange(SignalStrategy::State state) override; |
| 30 bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override; |
| 31 |
| 32 void OnSubscriptionResult(IqRequest* request, |
| 33 const buzz::XmlElement* response); |
| 34 |
| 35 SignalStrategy* signal_strategy_; |
| 36 scoped_ptr<IqSender> iq_sender_; |
| 37 scoped_ptr<IqRequest> iq_request_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(GcdNotificationSubscriber); |
| 40 }; |
| 41 |
| 42 } // namespace remoting |
| 43 |
| 44 #endif // REMOTING_HOST_GCD_NOTIFICATION_SUBSCRIBER_H_ |
OLD | NEW |