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

Unified Diff: remoting/client/ios/facade/remoting_service.h

Issue 2854273002: [CRD iOS] Implementing save to keychain and user defaults for login info. Refactor remoting service. (Closed)
Patch Set: Removing authenticate with refresh token from pub api. Created 3 years, 7 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/client/ios/facade/remoting_service.h
diff --git a/remoting/client/ios/facade/remoting_service.h b/remoting/client/ios/facade/remoting_service.h
index 2f27fba1ad2b340a1dda0355a130ded17d34b75e..2a65639c2e788229080da01f31010733a70ad482 100644
--- a/remoting/client/ios/facade/remoting_service.h
+++ b/remoting/client/ios/facade/remoting_service.h
@@ -6,29 +6,22 @@
#define REMOTING_CLIENT_IOS_FACADE_REMOTING_SERVICE_H_
#import "remoting/client/chromoting_client_runtime.h"
-#import "remoting/client/ios/domain/host_info.h"
-#import "remoting/client/ios/domain/user_info.h"
#include "base/memory/weak_ptr.h"
#include "remoting/base/oauth_token_getter.h"
-// |RemotingAuthenticationDelegate|s are interested in authentication related
-// notifications.
-@protocol RemotingAuthenticationDelegate<NSObject>
+@class HostInfo;
+@class UserInfo;
+@class RemotingAuthentication;
-// Notifies the delegate that the authentication status of the current user has
-// changed to a new state.
-- (void)nowAuthenticated:(BOOL)authenticated;
+// Eventing related keys:
-@end
-
-// |RemotingHostListDelegate|s are interested in notifications related to host
-// list.
-@protocol RemotingHostListDelegate<NSObject>
-
-- (void)hostListUpdated;
-
-@end
+// Hosts did update event.
+extern NSString* const kHostsDidUpdate;
+// User did update event name.
+extern NSString* const kUserDidUpdate;
+// Map key for UserInfo object.
+extern NSString* const kUserInfo;
// |RemotingService| is the centralized place to ask for information about
// authentication or query the remote services. It also helps deal with the
@@ -39,38 +32,18 @@
// Access to the singleton shared instance from this method.
+ (RemotingService*)SharedInstance;
-// Access to the current |ChromotingClientRuntime| from this method.
-- (remoting::ChromotingClientRuntime*)runtime;
-
-// Register to be a |RemotingAuthenticationDelegate|.
-- (void)setAuthenticationDelegate:(id<RemotingAuthenticationDelegate>)delegate;
-
-// A cached answer if there is a currently authenticated user.
-- (BOOL)isAuthenticated;
-
-// Provide an |authorizationCode| to authenticate a user as the first time user
-// of the application or OAuth Flow.
-- (void)authenticateWithAuthorizationCode:(NSString*)authorizationCode;
-
-// Provide the |refreshToken| and |email| to authenticate a user as a returning
-// user of the application.
-- (void)authenticateWithRefreshToken:(NSString*)refreshToken
- email:(NSString*)email;
-
-// Returns the currently logged in user info from cache, or nil if no
-// currently authenticated user.
-- (UserInfo*)getUser;
+// Start a request to fetch the host list. This will produce an notification on
+// |kHostsDidUpdate| when a new host is ready.
+- (void)requestHostListFetch;
-// Register to be a |RemotingHostListDelegate|. Side effect of setting this
-// delegate is the application will attempt to fetch a fresh host list.
-- (void)setHostListDelegate:(id<RemotingHostListDelegate>)delegate;
+@property(nonatomic, readonly) RemotingAuthentication* authentication;
-// Returns the currently cached host list or nil if none exist.
-- (NSArray<HostInfo*>*)getHosts;
+// Returns the current host list.
+@property(nonatomic, readonly) NSArray<HostInfo*>* hosts;
-// Fetches an OAuth Access Token and passes it back to the callback.
-- (void)callbackWithAccessToken:
- (const remoting::OAuthTokenGetter::TokenCallback&)onAccessToken;
+// The Chromoting Client Runtime, this holds the threads and other shared
+// resources used by the Chromoting clients
+@property(nonatomic, readonly) remoting::ChromotingClientRuntime* runtime;
@end
« no previous file with comments | « remoting/client/ios/facade/remoting_authentication.mm ('k') | remoting/client/ios/facade/remoting_service.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698