| 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_IOS_FACADE_REMOTING_SERVICE_H_ | 5 #ifndef REMOTING_IOS_FACADE_REMOTING_SERVICE_H_ |
| 6 #define REMOTING_IOS_FACADE_REMOTING_SERVICE_H_ | 6 #define REMOTING_IOS_FACADE_REMOTING_SERVICE_H_ |
| 7 | 7 |
| 8 #import "remoting/client/chromoting_client_runtime.h" | 8 #import "remoting/client/chromoting_client_runtime.h" |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | |
| 11 #include "remoting/base/oauth_token_getter.h" | |
| 12 | |
| 13 @class HostInfo; | 10 @class HostInfo; |
| 14 @class UserInfo; | 11 @class UserInfo; |
| 15 @class RemotingAuthentication; | 12 |
| 13 @protocol RemotingAuthentication; |
| 16 | 14 |
| 17 // Eventing related keys: | 15 // Eventing related keys: |
| 18 | 16 |
| 19 // Hosts did update event. | 17 // Hosts did update event. |
| 20 extern NSString* const kHostsDidUpdate; | 18 extern NSString* const kHostsDidUpdate; |
| 21 // User did update event name. | 19 // User did update event name. |
| 22 extern NSString* const kUserDidUpdate; | 20 extern NSString* const kUserDidUpdate; |
| 23 // Map key for UserInfo object. | 21 // Map key for UserInfo object. |
| 24 extern NSString* const kUserInfo; | 22 extern NSString* const kUserInfo; |
| 25 | 23 |
| 26 // |RemotingService| is the centralized place to ask for information about | 24 // |RemotingService| is the centralized place to ask for information about |
| 27 // authentication or query the remote services. It also helps deal with the | 25 // authentication or query the remote services. It also helps deal with the |
| 28 // runtime and threading used in the application. |RemotingService| is a | 26 // runtime and threading used in the application. |RemotingService| is a |
| 29 // singleton and should only be accessed via the |SharedInstance| method. | 27 // singleton and should only be accessed via the |SharedInstance| method. |
| 30 @interface RemotingService : NSObject | 28 @interface RemotingService : NSObject |
| 31 | 29 |
| 32 // Access to the singleton shared instance from this method. | 30 // Access to the singleton shared instance from this method. |
| 33 + (RemotingService*)SharedInstance; | 31 + (RemotingService*)SharedInstance; |
| 34 | 32 |
| 35 // Start a request to fetch the host list. This will produce an notification on | 33 // Start a request to fetch the host list. This will produce an notification on |
| 36 // |kHostsDidUpdate| when a new host is ready. | 34 // |kHostsDidUpdate| when a new host is ready. |
| 37 - (void)requestHostListFetch; | 35 - (void)requestHostListFetch; |
| 38 | 36 |
| 39 @property(nonatomic, readonly) RemotingAuthentication* authentication; | |
| 40 | |
| 41 // Returns the current host list. | 37 // Returns the current host list. |
| 42 @property(nonatomic, readonly) NSArray<HostInfo*>* hosts; | 38 @property(nonatomic, readonly) NSArray<HostInfo*>* hosts; |
| 43 | 39 |
| 44 // The Chromoting Client Runtime, this holds the threads and other shared | 40 // The Chromoting Client Runtime, this holds the threads and other shared |
| 45 // resources used by the Chromoting clients | 41 // resources used by the Chromoting clients |
| 46 @property(nonatomic, readonly) remoting::ChromotingClientRuntime* runtime; | 42 @property(nonatomic, readonly) remoting::ChromotingClientRuntime* runtime; |
| 47 | 43 |
| 44 // This must be set immediately after the authentication object is created. It |
| 45 // can only be set once. |
| 46 @property(nonatomic) id<RemotingAuthentication> authentication; |
| 47 |
| 48 @end | 48 @end |
| 49 | 49 |
| 50 #endif // REMOTING_IOS_FACADE_REMOTING_SERVICE_H_ | 50 #endif // REMOTING_IOS_FACADE_REMOTING_SERVICE_H_ |
| OLD | NEW |