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

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

Issue 2794013005: CRD iOS: Updating remoting service to use oauth and host list fetcher. (Closed)
Patch Set: Update h guard. Created 3 years, 8 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 18ca8811f22145a4379a1b969ff48cd643c9598d..92011ce70b5708eaf0d883afe35a4e022f67bf79 100644
--- a/remoting/client/ios/facade/remoting_service.h
+++ b/remoting/client/ios/facade/remoting_service.h
@@ -5,16 +5,65 @@
#ifndef REMOTING_CLIENT_IOS_FACADE_REMOTING_SERCICE_H_
joedow 2017/04/05 22:30:55 Can you fix this header guard (SERCICE is a typo):
nicholss 2017/04/07 18:16:15 Done.
#define REMOTING_CLIENT_IOS_FACADE_REMOTING_SERCICE_H_
+#include "base/memory/weak_ptr.h"
+#import "remoting/client/chromoting_client_runtime.h"
#import "remoting/client/ios/domain/host_info.h"
#import "remoting/client/ios/domain/user_info.h"
+// |RemotingAuthenticationDelegate|'s are interesed in authentication related
joedow 2017/04/05 22:30:55 nit: remove apostrophe (non-possessive) and fix in
nicholss 2017/04/07 18:16:15 Done.
+// notifications.
+@protocol RemotingAuthenticationDelegate<NSObject>
+
+// Notifies the delegate that the authentication status of the current user has
+// changed to a new state.
+- (void)nowAuthenticated:(BOOL)authenticated;
+
+@end
+
+// |RemotingHostListDelegate|'s are interested in notifications related to host
joedow 2017/04/05 22:30:55 remove apostrophe
nicholss 2017/04/07 18:16:15 Done.
+// list.
+@protocol RemotingHostListDelegate<NSObject>
+
+- (void)hostListUpdated;
+
+@end
+
+// |RemotingService| is the centralized place to ask for information about
+// authentication or query the remote services. It also helps deal with the
+// runtime and threading used in the application. |RemotingService| is a
+// singleton and should only be accessed via the |SharedInstance| method.
@interface RemotingService : NSObject
-+ (RemotingService*)sharedInstance;
+// 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|.
joedow 2017/04/05 22:30:55 Does the caller need to unregister at some point?
nicholss 2017/04/07 18:16:15 No need to unregister, it is a pretty common iOS p
+- (void)setAuthenticationDelegate:(id<RemotingAuthenticationDelegate>)delegate;
+
+// A cached answer if there is a currently authenticated user.
joedow 2017/04/05 22:30:55 Isn't this just the current authentication state (
nicholss 2017/04/07 18:16:15 I said cache because it is not validating that the
- (BOOL)isAuthenticated;
+
+// Provide an |authorizationCode| to authenticate a user as the first time user
+// of the applicaiton or OAuth Flow.
joedow 2017/04/05 22:30:55 typo: applicaiton -> application
nicholss 2017/04/07 18:16:15 Done.
- (void)authenticateWithAuthorizationCode:(NSString*)authorizationCode;
+
+// Provide the |refreshToken| and |email| to authenticate a user as a returning
+// user of the application.
+- (void)authenticateWithRefreshToken:(NSString*)refreshToken
+ emai:(NSString*)email;
joedow 2017/04/05 22:30:55 typo: emai -> rename to email
nicholss 2017/04/07 18:16:15 HA! I had not gotten to the point where I can use
+
+// Returns the currently logged in user info from cache, or nil if no
+// currently authenticated user.
- (UserInfo*)getUser;
+
+// Register to be a |RemotingHostListDelegate|. Side effect of setting this
+// delegate is the application will attempt to fetch a fresh host list.
joedow 2017/04/05 22:30:55 Just curious, why is the host list fetched again?
nicholss 2017/04/07 18:16:15 In reality there is only one object that will ever
joedow 2017/04/10 16:09:59 SGTM
+- (void)setHostListDelegate:(id<RemotingHostListDelegate>)delegate;
+
+// Returns the currently cached host list or nil if none exist.
- (NSArray<HostInfo*>*)getHosts;
@end

Powered by Google App Engine
This is Rietveld 408576698