Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1108)

Unified Diff: remoting/ios/bridge/client_controller.h

Issue 186733007: iOS Chromoting Client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/ios/bridge/client_controller.h
diff --git a/remoting/ios/bridge/client_controller.h b/remoting/ios/bridge/client_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..497d696faf01bb75bf3f043b509e726083999a5d
--- /dev/null
+++ b/remoting/ios/bridge/client_controller.h
@@ -0,0 +1,106 @@
+// Copyright 2014 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_IOS_BRIDGE_CHROMOTING_INTERFACE_H_
+#define REMOTING_IOS_BRIDGE_CHROMOTING_INTERFACE_H_
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+#include <vector>
+
+#include "base/memory/ref_counted.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
+
+namespace remoting {
+class ClientBridge;
+} // namespace remoting
+
+// Contract to provide for callbacks from an async communication channel
+// by the C++ code base to OBJ_C++.
+@protocol ClientControllerDelegate<NSObject>
+// HOST request for client to input their PIN.
+- (void)requestHostPin:(BOOL)pairingSupported;
dcaiafa 2014/03/19 01:14:15 nit: Add blank line between methods.
aboone 2014/03/21 16:42:07 Done.
+// HOST notification that a connection has been successfully opened.
+- (void)connected;
+// HOST notification that a connection has failed.
+- (void)connectionFailed:(NSString*)errorMessage;
+// HOST notification for a change in connections status.
+- (void)connectionStatus:(NSString*)statusMessage;
+// A new Canvas (desktop) update has arrived.
+- (void)applyFrame:(const webrtc::DesktopSize&)size
+ stride:(NSInteger)stride
+ data:(uint8_t*)data
+ regions:(const std::vector<webrtc::DesktopRect>&)regions;
+// A new Cursor (mouse) update has arrived.
+- (void)applyCursor:(const webrtc::DesktopSize&)size
+ hotspot:(const webrtc::DesktopVector&)hotspot
+ cursorData:(uint8_t*)data;
+@end
+
+// ClientController is part of a bridge from the Chromoting C++ code base (HOST)
+// to an iOS OBJ_C++ UI application (CLIENT) front end. ClientController
+// represents the CLIENT side of the bridge, and communicates with a C/OBJ-C
+// implimented class ClientBridge to process input/output with the
dcaiafa 2014/03/19 01:14:15 nit: spelling.
aboone 2014/03/21 16:42:07 Done.
+// (HOST). The majority of the functions are simply pass through.
+@interface ClientController : NSObject {
+ @private
+ scoped_refptr<remoting::ClientBridge> _bridge;
+ __weak id<ClientControllerDelegate> _delegate;
+ BOOL _isConnected;
+}
+
+// Accepts credentials from CLIENT and sends them to the HOST as an async
+// process.
+- (void)connectToHost:(NSString*)username
+ authToken:(NSString*)token
+ jabberId:(NSString*)jid
+ hostId:(NSString*)hostId
+ publicKey:(NSString*)hostPublicKey
+ delegate:(id<ClientControllerDelegate>)delegate;
+
+// Initiate a disconnection by CLIENT
+- (void)disconnectFromHost;
+
+// TRUE when a connection has been established successfully.
+- (BOOL)isConnected;
+
+// Request from HOST to fetch the User's PIN for host
+- (void)displayAuthenticationPrompt:(BOOL)pairingSupported;
+
+// Request from HOST to store User's credentials
+- (void)commitPairinedentials:(NSString*)hostId
+ pairId:(NSString*)pairId
+ secret:(NSString*)hostSecret;
+
+// Report errors from HOST
+- (void)reportConnectionStatus:(NSInteger)state error:(NSInteger)error;
+
+// Report from CLIENT of mouse input
+- (void)mouseAction:(const webrtc::DesktopVector&)position
+ wheelDelta:(const webrtc::DesktopVector&)wheelDelta
+ whichButton:(NSInteger)buttonPressed
+ buttonDown:(BOOL)buttonIsDown;
+
+// Report from CLIENT of keyboard input
+- (void)keyboardAction:(NSInteger)keyCode keyDown:(BOOL)keyIsDown;
+
+// Report from CLIENT with the user's PIN. Occurs after HOST has called
+// displayAuthenticationPrompt
+- (void)authenticationResponse:(NSString*)pin createPair:(BOOL)createPair;
+
+// HOST has delivered a Cursor (mouse) update
+- (void)updateCursorShape:(const webrtc::DesktopSize&)size
+ hotspot:(const webrtc::DesktopVector&)hotspot
+ cursorData:(uint8_t*)data;
+
+// HOST has delivered a Canvas (desktop) update
+- (void)updateImageBuffer:(const webrtc::DesktopSize&)size
+ stride:(NSInteger)stride
+ data:(uint8_t*)data
+ regions:(const std::vector<webrtc::DesktopRect>&)regions;
+
+@end
+
+#endif // REMOTING_IOS_BRIDGE_CHROMOTING_INTERFACE_H_

Powered by Google App Engine
This is Rietveld 408576698