| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef REMOTING_CLIENT_IOS_SESSION_REMOTING_CLIENT_H_ | 5 #ifndef REMOTING_CLIENT_IOS_SESSION_REMOTING_CLIENT_H_ |
| 6 #define REMOTING_CLIENT_IOS_SESSION_REMOTING_CLIENT_H_ | 6 #define REMOTING_CLIENT_IOS_SESSION_REMOTING_CLIENT_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 #import "remoting/client/ios/display/gl_display_handler.h" | 10 #include "remoting/protocol/connection_to_host.h" |
| 11 | 11 |
| 12 #include "remoting/protocol/connection_to_host.h" | 12 @class HostInfo; |
| 13 #include "remoting/protocol/session.h" | 13 @class GlDisplayHandler; |
| 14 | 14 |
| 15 namespace remoting { | 15 // A list of notifications that will be sent out for different types of Remoting |
| 16 struct ConnectToHostInfo; | 16 // Client events. |
| 17 } | 17 // |
| 18 extern NSString* const kHostSessionStatusChanged; |
| 19 extern NSString* const kHostSessionPinProvided; |
| 18 | 20 |
| 21 // List of keys in user info from events. |
| 22 extern NSString* const kSessionDetails; |
| 23 extern NSString* const kSessonStateErrorCode; |
| 24 extern NSString* const kHostSessionPin; |
| 25 |
| 26 // Remoting Client is the entry point for starting a session with a remote |
| 27 // host. This object should not be reused. Remoting Client will use the default |
| 28 // NSNotificationCenter to signal session state changes using the key |
| 29 // |kHostSessionStatusChanged|. It expects to receive an event back on |
| 30 // |kHostSessionPinProvided| when the session is asking for a PIN authenication. |
| 19 @interface RemotingClient : NSObject | 31 @interface RemotingClient : NSObject |
| 20 | 32 |
| 21 - (void)connectToHost:(const remoting::ConnectToHostInfo&)info; | 33 // Connect to a given host. |
| 34 // |hostInfo| is all the details around a host. |
| 35 // |username| is the username to be used when connecting. |
| 36 // |accessToken| is the oAuth access token to provided to create the session. |
| 37 - (void)connectToHost:(HostInfo*)hostInfo |
| 38 username:(NSString*)username |
| 39 accessToken:(NSString*)accessToken; |
| 22 | 40 |
| 23 // Mirrors the native client session delegate interface: | 41 // Mirrors the native client session delegate interface: |
| 24 | 42 |
| 25 - (void)onConnectionState:(remoting::protocol::ConnectionToHost::State)state | 43 - (void)onConnectionState:(remoting::protocol::ConnectionToHost::State)state |
| 26 error:(remoting::protocol::ErrorCode)error; | 44 error:(remoting::protocol::ErrorCode)error; |
| 27 | 45 |
| 28 - (void)commitPairingCredentialsForHost:(NSString*)host | 46 - (void)commitPairingCredentialsForHost:(NSString*)host |
| 29 id:(NSString*)id | 47 id:(NSString*)id |
| 30 secret:(NSString*)secret; | 48 secret:(NSString*)secret; |
| 31 | 49 |
| 32 - (void)fetchThirdPartyTokenForUrl:(NSString*)tokenUrl | 50 - (void)fetchThirdPartyTokenForUrl:(NSString*)tokenUrl |
| 33 clientId:(NSString*)clinetId | 51 clientId:(NSString*)clinetId |
| 34 scope:(NSString*)scope; | 52 scope:(NSString*)scope; |
| 35 | 53 |
| 36 - (void)setCapabilities:(NSString*)capabilities; | 54 - (void)setCapabilities:(NSString*)capabilities; |
| 37 | 55 |
| 38 - (void)handleExtensionMessageOfType:(NSString*)type message:(NSString*)message; | 56 - (void)handleExtensionMessageOfType:(NSString*)type message:(NSString*)message; |
| 39 | 57 |
| 58 // The display handler tied to the remoting client used to display the host. |
| 40 @property(nonatomic, strong) GlDisplayHandler* displayHandler; | 59 @property(nonatomic, strong) GlDisplayHandler* displayHandler; |
| 60 // The host info used to make the remoting client connection. |
| 61 @property(nonatomic, readonly) HostInfo* hostInfo; |
| 41 | 62 |
| 42 @end | 63 @end |
| 43 | 64 |
| 44 #endif // REMOTING_CLIENT_IOS_SESSION_REMOTING_CLIENT_H_ | 65 #endif // REMOTING_CLIENT_IOS_SESSION_REMOTING_CLIENT_H_ |
| OLD | NEW |