OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_STATUS_SENDER_H_ | 5 #ifndef REMOTING_HOST_STATUS_SENDER_H_ |
6 #define REMOTING_HOST_STATUS_SENDER_H_ | 6 #define REMOTING_HOST_STATUS_SENDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 }; | 56 }; |
57 | 57 |
58 HostStatusSender(const std::string& host_id, | 58 HostStatusSender(const std::string& host_id, |
59 SignalStrategy* signal_strategy, | 59 SignalStrategy* signal_strategy, |
60 scoped_refptr<RsaKeyPair> key_pair, | 60 scoped_refptr<RsaKeyPair> key_pair, |
61 const std::string& directory_bot_jid); | 61 const std::string& directory_bot_jid); |
62 virtual ~HostStatusSender(); | 62 virtual ~HostStatusSender(); |
63 | 63 |
64 // SignalStrategy::Listener interface. | 64 // SignalStrategy::Listener interface. |
65 virtual void OnSignalStrategyStateChange( | 65 virtual void OnSignalStrategyStateChange( |
66 SignalStrategy::State state) OVERRIDE; | 66 SignalStrategy::State state) override; |
67 virtual bool OnSignalStrategyIncomingStanza( | 67 virtual bool OnSignalStrategyIncomingStanza( |
68 const buzz::XmlElement* stanza) OVERRIDE; | 68 const buzz::XmlElement* stanza) override; |
69 | 69 |
70 // APIs for sending host status XMPP messages to the chromoting bot. | 70 // APIs for sending host status XMPP messages to the chromoting bot. |
71 // status: the reason (exit code) why the host is offline. | 71 // status: the reason (exit code) why the host is offline. |
72 void SendOnlineStatus(); | 72 void SendOnlineStatus(); |
73 void SendOfflineStatus(HostExitCodes exit_code); | 73 void SendOfflineStatus(HostExitCodes exit_code); |
74 | 74 |
75 inline static const char* HostStatusToString(HostStatus host_status) { | 75 inline static const char* HostStatusToString(HostStatus host_status) { |
76 return host_status_strings_[host_status]; | 76 return host_status_strings_[host_status]; |
77 } | 77 } |
78 | 78 |
(...skipping 17 matching lines...) Expand all Loading... |
96 | 96 |
97 // The string representation of the HostStatus values. | 97 // The string representation of the HostStatus values. |
98 static const char* const host_status_strings_[2]; | 98 static const char* const host_status_strings_[2]; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(HostStatusSender); | 100 DISALLOW_COPY_AND_ASSIGN(HostStatusSender); |
101 }; | 101 }; |
102 | 102 |
103 } // namespace remoting | 103 } // namespace remoting |
104 | 104 |
105 #endif // REMOTING_HOST_STATUS_SENDER_H_ | 105 #endif // REMOTING_HOST_STATUS_SENDER_H_ |
OLD | NEW |