OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef REMOTING_HOST_HOST_CHANGE_NOTIFICATION_LISTENER_H | 5 #ifndef REMOTING_HOST_HOST_CHANGE_NOTIFICATION_LISTENER_H |
6 #define REMOTING_HOST_HOST_CHANGE_NOTIFICATION_LISTENER_H | 6 #define REMOTING_HOST_HOST_CHANGE_NOTIFICATION_LISTENER_H |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // Invoked when a notification that the host was deleted is received. | 30 // Invoked when a notification that the host was deleted is received. |
31 public: | 31 public: |
32 virtual void OnHostDeleted() = 0; | 32 virtual void OnHostDeleted() = 0; |
33 }; | 33 }; |
34 | 34 |
35 // Both listener and signal_strategy are expected to outlive this object. | 35 // Both listener and signal_strategy are expected to outlive this object. |
36 HostChangeNotificationListener(Listener* listener, | 36 HostChangeNotificationListener(Listener* listener, |
37 const std::string& host_id, | 37 const std::string& host_id, |
38 SignalStrategy* signal_strategy, | 38 SignalStrategy* signal_strategy, |
39 const std::string& directory_bot_jid); | 39 const std::string& directory_bot_jid); |
40 virtual ~HostChangeNotificationListener(); | 40 ~HostChangeNotificationListener() override; |
41 | 41 |
42 // SignalStrategy::Listener interface. | 42 // SignalStrategy::Listener interface. |
43 virtual void OnSignalStrategyStateChange( | 43 void OnSignalStrategyStateChange(SignalStrategy::State state) override; |
44 SignalStrategy::State state) override; | 44 bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override; |
45 virtual bool OnSignalStrategyIncomingStanza( | |
46 const buzz::XmlElement* stanza) override; | |
47 | 45 |
48 private: | 46 private: |
49 void OnHostDeleted(); | 47 void OnHostDeleted(); |
50 | 48 |
51 Listener* listener_; | 49 Listener* listener_; |
52 std::string host_id_; | 50 std::string host_id_; |
53 SignalStrategy* signal_strategy_; | 51 SignalStrategy* signal_strategy_; |
54 std::string directory_bot_jid_; | 52 std::string directory_bot_jid_; |
55 base::WeakPtrFactory<HostChangeNotificationListener> weak_factory_; | 53 base::WeakPtrFactory<HostChangeNotificationListener> weak_factory_; |
56 DISALLOW_COPY_AND_ASSIGN(HostChangeNotificationListener); | 54 DISALLOW_COPY_AND_ASSIGN(HostChangeNotificationListener); |
57 }; | 55 }; |
58 | 56 |
59 } // namespace remoting | 57 } // namespace remoting |
60 | 58 |
61 #endif // REMOTING_HOST_HOST_CHANGE_NOTIFICATION_LISTENER_H | 59 #endif // REMOTING_HOST_HOST_CHANGE_NOTIFICATION_LISTENER_H |
OLD | NEW |