| 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 16 matching lines...) Expand all Loading... |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 #include "ppapi/cpp/instance.h" | 29 #include "ppapi/cpp/instance.h" |
| 30 #include "remoting/client/client_context.h" | 30 #include "remoting/client/client_context.h" |
| 31 #include "remoting/client/client_user_interface.h" | 31 #include "remoting/client/client_user_interface.h" |
| 32 #include "remoting/client/key_event_mapper.h" | 32 #include "remoting/client/key_event_mapper.h" |
| 33 #include "remoting/client/plugin/mac_key_event_processor.h" | 33 #include "remoting/client/plugin/mac_key_event_processor.h" |
| 34 #include "remoting/client/plugin/pepper_input_handler.h" | 34 #include "remoting/client/plugin/pepper_input_handler.h" |
| 35 #include "remoting/client/plugin/pepper_plugin_thread_delegate.h" | 35 #include "remoting/client/plugin/pepper_plugin_thread_delegate.h" |
| 36 #include "remoting/proto/event.pb.h" | 36 #include "remoting/proto/event.pb.h" |
| 37 #include "remoting/protocol/client_stub.h" |
| 37 #include "remoting/protocol/clipboard_stub.h" | 38 #include "remoting/protocol/clipboard_stub.h" |
| 38 #include "remoting/protocol/connection_to_host.h" | 39 #include "remoting/protocol/connection_to_host.h" |
| 39 #include "remoting/protocol/cursor_shape_stub.h" | 40 #include "remoting/protocol/cursor_shape_stub.h" |
| 40 #include "remoting/protocol/input_event_tracker.h" | 41 #include "remoting/protocol/input_event_tracker.h" |
| 41 #include "remoting/protocol/mouse_input_filter.h" | 42 #include "remoting/protocol/mouse_input_filter.h" |
| 42 #include "remoting/protocol/negotiating_client_authenticator.h" | 43 #include "remoting/protocol/negotiating_client_authenticator.h" |
| 43 #include "remoting/protocol/third_party_client_authenticator.h" | 44 #include "remoting/protocol/third_party_client_authenticator.h" |
| 44 | 45 |
| 45 namespace base { | 46 namespace base { |
| 46 class DictionaryValue; | 47 class DictionaryValue; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 73 public base::SupportsWeakPtr<ChromotingInstance> { | 74 public base::SupportsWeakPtr<ChromotingInstance> { |
| 74 public: | 75 public: |
| 75 // Plugin API version. This should be incremented whenever the API | 76 // Plugin API version. This should be incremented whenever the API |
| 76 // interface changes. | 77 // interface changes. |
| 77 static const int kApiVersion = 7; | 78 static const int kApiVersion = 7; |
| 78 | 79 |
| 79 // Plugin API features. This allows orthogonal features to be supported | 80 // Plugin API features. This allows orthogonal features to be supported |
| 80 // without bumping the API version. | 81 // without bumping the API version. |
| 81 static const char kApiFeatures[]; | 82 static const char kApiFeatures[]; |
| 82 | 83 |
| 84 // Capabilities supported by the plugin that should also be supported by the |
| 85 // webapp to be enabled. |
| 86 static const char kRequestedCapabilities[]; |
| 87 |
| 88 // Capabilities supported by the plugin that do not need to be supported by |
| 89 // the webapp to be enabled. |
| 90 static const char kSupportedCapabilities[]; |
| 91 |
| 83 // Backward-compatibility version used by for the messaging | 92 // Backward-compatibility version used by for the messaging |
| 84 // interface. Should be updated whenever we remove support for | 93 // interface. Should be updated whenever we remove support for |
| 85 // an older version of the API. | 94 // an older version of the API. |
| 86 static const int kApiMinMessagingVersion = 5; | 95 static const int kApiMinMessagingVersion = 5; |
| 87 | 96 |
| 88 // Backward-compatibility version used by for the ScriptableObject | 97 // Backward-compatibility version used by for the ScriptableObject |
| 89 // interface. Should be updated whenever we remove support for | 98 // interface. Should be updated whenever we remove support for |
| 90 // an older version of the API. | 99 // an older version of the API. |
| 91 static const int kApiMinScriptableVersion = 5; | 100 static const int kApiMinScriptableVersion = 5; |
| 92 | 101 |
| 93 // Helper method to parse authentication_methods parameter. | 102 // Helper method to parse authentication_methods parameter. |
| 94 static bool ParseAuthMethods(const std::string& auth_methods, | 103 static bool ParseAuthMethods(const std::string& auth_methods, |
| 95 ClientConfig* config); | 104 ClientConfig* config); |
| 96 | 105 |
| 97 explicit ChromotingInstance(PP_Instance instance); | 106 explicit ChromotingInstance(PP_Instance instance); |
| 98 virtual ~ChromotingInstance(); | 107 virtual ~ChromotingInstance(); |
| 99 | 108 |
| 100 // pp::Instance interface. | 109 // pp::Instance interface. |
| 101 virtual void DidChangeView(const pp::View& view) OVERRIDE; | 110 virtual void DidChangeView(const pp::View& view) OVERRIDE; |
| 102 virtual bool Init(uint32_t argc, const char* argn[], | 111 virtual bool Init(uint32_t argc, const char* argn[], |
| 103 const char* argv[]) OVERRIDE; | 112 const char* argv[]) OVERRIDE; |
| 104 virtual void HandleMessage(const pp::Var& message) OVERRIDE; | 113 virtual void HandleMessage(const pp::Var& message) OVERRIDE; |
| 105 virtual bool HandleInputEvent(const pp::InputEvent& event) OVERRIDE; | 114 virtual bool HandleInputEvent(const pp::InputEvent& event) OVERRIDE; |
| 106 | 115 |
| 107 // ClientUserInterface interface. | 116 // ClientUserInterface interface. |
| 108 virtual void OnConnectionState(protocol::ConnectionToHost::State state, | 117 virtual void OnConnectionState(protocol::ConnectionToHost::State state, |
| 109 protocol::ErrorCode error) OVERRIDE; | 118 protocol::ErrorCode error) OVERRIDE; |
| 110 virtual void OnConnectionReady(bool ready) OVERRIDE; | 119 virtual void OnConnectionReady(bool ready) OVERRIDE; |
| 120 virtual void SetCapabilities(const std::string& capabilities) OVERRIDE; |
| 111 virtual protocol::ClipboardStub* GetClipboardStub() OVERRIDE; | 121 virtual protocol::ClipboardStub* GetClipboardStub() OVERRIDE; |
| 112 virtual protocol::CursorShapeStub* GetCursorShapeStub() OVERRIDE; | 122 virtual protocol::CursorShapeStub* GetCursorShapeStub() OVERRIDE; |
| 113 virtual scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher> | 123 virtual scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher> |
| 114 GetTokenFetcher(const std::string& host_public_key) OVERRIDE; | 124 GetTokenFetcher(const std::string& host_public_key) OVERRIDE; |
| 115 | 125 |
| 116 // protocol::ClipboardStub interface. | 126 // protocol::ClipboardStub interface. |
| 117 virtual void InjectClipboardEvent( | 127 virtual void InjectClipboardEvent( |
| 118 const protocol::ClipboardEvent& event) OVERRIDE; | 128 const protocol::ClipboardEvent& event) OVERRIDE; |
| 119 | 129 |
| 120 // protocol::CursorShapeStub interface. | 130 // protocol::CursorShapeStub interface. |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 base::WeakPtr<PepperTokenFetcher> pepper_token_fetcher_; | 253 base::WeakPtr<PepperTokenFetcher> pepper_token_fetcher_; |
| 244 | 254 |
| 245 base::WeakPtrFactory<ChromotingInstance> weak_factory_; | 255 base::WeakPtrFactory<ChromotingInstance> weak_factory_; |
| 246 | 256 |
| 247 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); | 257 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); |
| 248 }; | 258 }; |
| 249 | 259 |
| 250 } // namespace remoting | 260 } // namespace remoting |
| 251 | 261 |
| 252 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ | 262 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ |
| OLD | NEW |