| 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 // TODO(ajwong): We need to come up with a better description of the | 5 // TODO(ajwong): We need to come up with a better description of the |
| 6 // responsibilities for each thread. | 6 // responsibilities for each thread. |
| 7 | 7 |
| 8 #ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 8 #ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
| 9 #define REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 9 #define REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 #include "ppapi/cpp/private/instance_private.h" | 27 #include "ppapi/cpp/private/instance_private.h" |
| 28 #include "remoting/base/scoped_thread_proxy.h" | 28 #include "remoting/base/scoped_thread_proxy.h" |
| 29 #include "remoting/client/client_context.h" | 29 #include "remoting/client/client_context.h" |
| 30 #include "remoting/client/key_event_mapper.h" | 30 #include "remoting/client/key_event_mapper.h" |
| 31 #include "remoting/client/plugin/mac_key_event_processor.h" | 31 #include "remoting/client/plugin/mac_key_event_processor.h" |
| 32 #include "remoting/client/plugin/pepper_plugin_thread_delegate.h" | 32 #include "remoting/client/plugin/pepper_plugin_thread_delegate.h" |
| 33 #include "remoting/proto/event.pb.h" | 33 #include "remoting/proto/event.pb.h" |
| 34 #include "remoting/protocol/clipboard_stub.h" | 34 #include "remoting/protocol/clipboard_stub.h" |
| 35 #include "remoting/protocol/cursor_shape_stub.h" |
| 35 #include "remoting/protocol/connection_to_host.h" | 36 #include "remoting/protocol/connection_to_host.h" |
| 36 | 37 |
| 37 namespace base { | 38 namespace base { |
| 38 class DictionaryValue; | 39 class DictionaryValue; |
| 39 } // namespace base | 40 } // namespace base |
| 40 | 41 |
| 41 namespace pp { | 42 namespace pp { |
| 42 class InputEvent; | 43 class InputEvent; |
| 43 class Module; | 44 class Module; |
| 44 } // namespace pp | 45 } // namespace pp |
| (...skipping 13 matching lines...) Expand all Loading... |
| 58 class FrameConsumerProxy; | 59 class FrameConsumerProxy; |
| 59 class PepperInputHandler; | 60 class PepperInputHandler; |
| 60 class PepperView; | 61 class PepperView; |
| 61 class PepperXmppProxy; | 62 class PepperXmppProxy; |
| 62 class RectangleUpdateDecoder; | 63 class RectangleUpdateDecoder; |
| 63 | 64 |
| 64 struct ClientConfig; | 65 struct ClientConfig; |
| 65 | 66 |
| 66 class ChromotingInstance : | 67 class ChromotingInstance : |
| 67 public protocol::ClipboardStub, | 68 public protocol::ClipboardStub, |
| 69 public protocol::CursorShapeStub, |
| 68 public pp::InstancePrivate, | 70 public pp::InstancePrivate, |
| 69 public base::SupportsWeakPtr<ChromotingInstance> { | 71 public base::SupportsWeakPtr<ChromotingInstance> { |
| 70 public: | 72 public: |
| 71 // These state values are duplicated in the JS code. Remember to | 73 // These state values are duplicated in the JS code. Remember to |
| 72 // update both copies when making changes. | 74 // update both copies when making changes. |
| 73 enum ConnectionState { | 75 enum ConnectionState { |
| 74 STATE_CONNECTING = 1, | 76 STATE_CONNECTING = 1, |
| 75 STATE_INITIALIZING, | 77 STATE_INITIALIZING, |
| 76 STATE_CONNECTED, | 78 STATE_CONNECTED, |
| 77 STATE_CLOSED, | 79 STATE_CLOSED, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 virtual void HandleMessage(const pp::Var& message) OVERRIDE; | 124 virtual void HandleMessage(const pp::Var& message) OVERRIDE; |
| 123 virtual bool HandleInputEvent(const pp::InputEvent& event) OVERRIDE; | 125 virtual bool HandleInputEvent(const pp::InputEvent& event) OVERRIDE; |
| 124 | 126 |
| 125 // pp::InstancePrivate interface. | 127 // pp::InstancePrivate interface. |
| 126 virtual pp::Var GetInstanceObject() OVERRIDE; | 128 virtual pp::Var GetInstanceObject() OVERRIDE; |
| 127 | 129 |
| 128 // ClipboardStub implementation. | 130 // ClipboardStub implementation. |
| 129 virtual void InjectClipboardEvent(const protocol::ClipboardEvent& event) | 131 virtual void InjectClipboardEvent(const protocol::ClipboardEvent& event) |
| 130 OVERRIDE; | 132 OVERRIDE; |
| 131 | 133 |
| 134 // CursorShapeStub implementation. |
| 135 virtual void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) |
| 136 OVERRIDE; |
| 137 |
| 132 // Called by PepperView. | 138 // Called by PepperView. |
| 133 void SetDesktopSize(int width, int height); | 139 void SetDesktopSize(int width, int height); |
| 134 void SetConnectionState(ConnectionState state, ConnectionError error); | 140 void SetConnectionState(ConnectionState state, ConnectionError error); |
| 135 void OnFirstFrameReceived(); | 141 void OnFirstFrameReceived(); |
| 136 | 142 |
| 137 // Convenience wrapper to get the ChromotingScriptableObject. | 143 // Convenience wrapper to get the ChromotingScriptableObject. |
| 138 ChromotingScriptableObject* GetScriptableObject(); | 144 ChromotingScriptableObject* GetScriptableObject(); |
| 139 | 145 |
| 140 // Message handlers for messages that come from JavaScript. Called | 146 // Message handlers for messages that come from JavaScript. Called |
| 141 // from HandleMessage() and ChromotingScriptableObject. | 147 // from HandleMessage() and ChromotingScriptableObject. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 pp::Var instance_object_; | 232 pp::Var instance_object_; |
| 227 | 233 |
| 228 scoped_ptr<ScopedThreadProxy> thread_proxy_; | 234 scoped_ptr<ScopedThreadProxy> thread_proxy_; |
| 229 | 235 |
| 230 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); | 236 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); |
| 231 }; | 237 }; |
| 232 | 238 |
| 233 } // namespace remoting | 239 } // namespace remoting |
| 234 | 240 |
| 235 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 241 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
| OLD | NEW |