OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_IOS_BRIDGE_HOST_PROXY_H_ |
| 6 #define REMOTING_IOS_BRIDGE_HOST_PROXY_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include <objc/objc.h> |
| 11 #include "base/memory/weak_ptr.h" |
| 12 #include "remoting/protocol/connection_to_host.h" |
| 13 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
| 14 |
| 15 #if defined(__OBJC__) |
| 16 @class ClientProxyDelegateWrapper; |
| 17 #else // __OBJC__ |
| 18 class ClientProxyDelegateWrapper; |
| 19 #endif // __OBJC__ |
| 20 |
| 21 namespace remoting { |
| 22 |
| 23 // Proxies incoming common Chromoting protocol (HOST) to the UI Application |
| 24 // (CLIENT). The HOST will have a Weak reference to call member functions on |
| 25 // the UI Thread. |
| 26 class ClientProxy : public base::SupportsWeakPtr<ClientProxy> { |
| 27 public: |
| 28 ClientProxy(ClientProxyDelegateWrapper* wrapper); |
| 29 |
| 30 // Notifies the user of the current connection status. |
| 31 void ReportConnectionStatus(protocol::ConnectionToHost::State state, |
| 32 protocol::ErrorCode error); |
| 33 |
| 34 // Display a dialog box asking the user to enter a PIN. |
| 35 void DisplayAuthenticationPrompt(bool pairing_supported); |
| 36 |
| 37 // Saves new pairing credentials to permanent storage. |
| 38 void CommitPairingCredentials(const std::string& hostId, |
| 39 const std::string& pairId, |
| 40 const std::string& pairSecret); |
| 41 |
| 42 // Delivers the latest image buffer for the canvas. |
| 43 void RedrawCanvas(const webrtc::DesktopSize& view_size, |
| 44 webrtc::DesktopFrame* buffer, |
| 45 const webrtc::DesktopRegion& region); |
| 46 |
| 47 // Updates cursor. |
| 48 void UpdateCursorShape(const protocol::CursorShapeInfo& cursor_shape); |
| 49 |
| 50 private: |
| 51 // Pointer to the UI application which implements the ClientProxyDelegate. |
| 52 // (id) is similar to a (void*) |delegate_| is set from accepting a |
| 53 // strongly typed @interface which wraps the @protocol ClientProxyDelegate. |
| 54 // see comments for host_proxy_delegate_wrapper.h |
| 55 id delegate_; |
| 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(ClientProxy); |
| 58 }; |
| 59 |
| 60 } // namespace remoting |
| 61 |
| 62 #endif // REMOTING_IOS_BRIDGE_HOST_PROXY_H_ |
OLD | NEW |