summaryrefslogtreecommitdiffstats
path: root/remoting/protocol/connection_to_host.h
diff options
context:
space:
mode:
authorgarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-04 22:44:41 +0000
committergarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-04 22:44:41 +0000
commitd11535a810717cd12a32a1a98080b2029c838547 (patch)
treebfb4ef1af1d49e6db34c932af52e3dd143f67f67 /remoting/protocol/connection_to_host.h
parentd5805b3d99d2d2b3774416cc754221a63a714ad2 (diff)
downloadchromium_src-d11535a810717cd12a32a1a98080b2029c838547.zip
chromium_src-d11535a810717cd12a32a1a98080b2029c838547.tar.gz
chromium_src-d11535a810717cd12a32a1a98080b2029c838547.tar.bz2
Chromoting: Rename HostConnection to ConnectionToHost
BUG=none TEST=build chrome, chromoting Review URL: http://codereview.chromium.org/4457002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65121 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol/connection_to_host.h')
-rw-r--r--remoting/protocol/connection_to_host.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/remoting/protocol/connection_to_host.h b/remoting/protocol/connection_to_host.h
new file mode 100644
index 0000000..7905c18
--- /dev/null
+++ b/remoting/protocol/connection_to_host.h
@@ -0,0 +1,63 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_
+#define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_
+
+#include "base/ref_counted.h"
+#include "base/scoped_ptr.h"
+#include "remoting/proto/internal.pb.h"
+#include "remoting/protocol/message_decoder.h"
+
+namespace remoting {
+
+struct ClientConfig;
+
+namespace protocol {
+
+class VideoStub;
+
+class ConnectionToHost {
+ public:
+ class HostEventCallback {
+ public:
+ virtual ~HostEventCallback() {}
+
+ // Handles an event received by the protocol::ConnectionToHost. Ownership of
+ // the message is passed to the callee.
+ virtual void HandleMessage(ConnectionToHost* conn,
+ ChromotingHostMessage* message) = 0;
+
+ // Called when the network connection is opened.
+ virtual void OnConnectionOpened(ConnectionToHost* conn) = 0;
+
+ // Called when the network connection is closed.
+ virtual void OnConnectionClosed(ConnectionToHost* conn) = 0;
+
+ // Called when the network connection has failed.
+ virtual void OnConnectionFailed(ConnectionToHost* conn) = 0;
+ };
+
+ virtual ~ConnectionToHost() {}
+
+ // TODO(ajwong): We need to generalize this API.
+ virtual void Connect(const ClientConfig& config,
+ HostEventCallback* event_callback,
+ VideoStub* video_stub) = 0;
+ virtual void Disconnect() = 0;
+
+ // Send an input event to the host.
+ virtual void SendEvent(const ChromotingClientMessage& msg) = 0;
+
+ protected:
+ ConnectionToHost() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ConnectionToHost);
+};
+
+} // namespace protocol
+} // namespace remoting
+
+#endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_