Roll Clang 206824:209387
[chromium-blink-merge.git] / remoting / ios / bridge / client_proxy.h
blob8088570550f565d40c930a9a4a6d94e905f55889
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.
5 #ifndef REMOTING_IOS_BRIDGE_HOST_PROXY_H_
6 #define REMOTING_IOS_BRIDGE_HOST_PROXY_H_
8 #include <string>
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"
15 #if defined(__OBJC__)
16 @class ClientProxyDelegateWrapper;
17 #else // __OBJC__
18 class ClientProxyDelegateWrapper;
19 #endif // __OBJC__
21 namespace remoting {
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);
30 // Notifies the user of the current connection status.
31 void ReportConnectionStatus(protocol::ConnectionToHost::State state,
32 protocol::ErrorCode error);
34 // Display a dialog box asking the user to enter a PIN.
35 void DisplayAuthenticationPrompt(bool pairing_supported);
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);
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);
47 // Updates cursor.
48 void UpdateCursorShape(const protocol::CursorShapeInfo& cursor_shape);
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_;
57 DISALLOW_COPY_AND_ASSIGN(ClientProxy);
60 } // namespace remoting
62 #endif // REMOTING_IOS_BRIDGE_HOST_PROXY_H_