| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PROTOCOL_CONNECTION_TO_HOST_H_ | 5 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
| 6 #define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 6 #define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // update these locations if you make any changes to the ordering. | 39 // update these locations if you make any changes to the ordering. |
| 40 enum State { | 40 enum State { |
| 41 INITIALIZING, | 41 INITIALIZING, |
| 42 CONNECTING, | 42 CONNECTING, |
| 43 AUTHENTICATED, | 43 AUTHENTICATED, |
| 44 CONNECTED, | 44 CONNECTED, |
| 45 FAILED, | 45 FAILED, |
| 46 CLOSED, | 46 CLOSED, |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 // Returns the literal string of |state|. |
| 50 static const char* StateToString(State state); |
| 51 |
| 49 class HostEventCallback { | 52 class HostEventCallback { |
| 50 public: | 53 public: |
| 51 virtual ~HostEventCallback() {} | 54 virtual ~HostEventCallback() {} |
| 52 | 55 |
| 53 // Called when state of the connection changes. | 56 // Called when state of the connection changes. |
| 54 virtual void OnConnectionState(State state, ErrorCode error) = 0; | 57 virtual void OnConnectionState(State state, ErrorCode error) = 0; |
| 55 | 58 |
| 56 // Called when ready state of the connection changes. When |ready| | 59 // Called when ready state of the connection changes. When |ready| |
| 57 // is set to false some data sent by the peers may be | 60 // is set to false some data sent by the peers may be |
| 58 // delayed. This is used to indicate in the UI when connection is | 61 // delayed. This is used to indicate in the UI when connection is |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 virtual InputStub* input_stub() = 0; | 106 virtual InputStub* input_stub() = 0; |
| 104 | 107 |
| 105 // Return the current state of ConnectionToHost. | 108 // Return the current state of ConnectionToHost. |
| 106 virtual State state() const = 0; | 109 virtual State state() const = 0; |
| 107 }; | 110 }; |
| 108 | 111 |
| 109 } // namespace protocol | 112 } // namespace protocol |
| 110 } // namespace remoting | 113 } // namespace remoting |
| 111 | 114 |
| 112 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 115 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
| OLD | NEW |