1 // Copyright 2013 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.
5 #ifndef REMOTING_CLIENT_PLUGIN_DELEGATING_SIGNAL_STRATEGY_H_
6 #define REMOTING_CLIENT_PLUGIN_DELEGATING_SIGNAL_STRATEGY_H_
8 #include "base/callback.h"
9 #include "base/observer_list.h"
10 #include "remoting/signaling/signal_strategy.h"
13 class SingleThreadTaskRunner
;
18 class DelegatingSignalStrategy
: public SignalStrategy
{
20 typedef base::Callback
<void(const std::string
&)> SendIqCallback
;
22 DelegatingSignalStrategy(std::string local_jid
,
23 const SendIqCallback
& send_iq_callback
);
24 ~DelegatingSignalStrategy() override
;
26 void OnIncomingMessage(const std::string
& message
);
28 // SignalStrategy interface.
29 void Connect() override
;
30 void Disconnect() override
;
31 State
GetState() const override
;
32 Error
GetError() const override
;
33 std::string
GetLocalJid() const override
;
34 void AddListener(Listener
* listener
) override
;
35 void RemoveListener(Listener
* listener
) override
;
36 bool SendStanza(scoped_ptr
<buzz::XmlElement
> stanza
) override
;
37 std::string
GetNextId() override
;
40 std::string local_jid_
;
41 SendIqCallback send_iq_callback_
;
43 base::ObserverList
<Listener
> listeners_
;
45 DISALLOW_COPY_AND_ASSIGN(DelegatingSignalStrategy
);
48 } // namespace remoting
50 #endif // REMOTING_CLIENT_PLUGIN_DELEGATING_SIGNAL_STRATEGY_H_