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

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: Fixing up code based on feedback. 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
« no previous file with comments | « remoting/client/ios/facade/host_list_fetcher.cc ('k') | remoting/client/ios/facade/remoting_service.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a92039dccc444ed0139b44bf91e1559f35cd7b37 100644
--- a/remoting/client/ios/facade/remoting_service.h
+++ b/remoting/client/ios/facade/remoting_service.h
@@ -2,21 +2,71 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef REMOTING_CLIENT_IOS_FACADE_REMOTING_SERCICE_H_
-#define REMOTING_CLIENT_IOS_FACADE_REMOTING_SERCICE_H_
+#ifndef REMOTING_CLIENT_IOS_FACADE_REMOTING_SERVICE_H_
+#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"
+
+// |RemotingAuthenticationDelegate|s are interested in authentication related
+// 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
+// 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|.
+- (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;
+
+// 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;
+
+// Returns the currently cached host list or nil if none exist.
- (NSArray<HostInfo*>*)getHosts;
@end
-#endif // REMOTING_CLIENT_IOS_FACADE_REMOTING_SERCICE_H_
+#endif // REMOTING_CLIENT_IOS_FACADE_REMOTING_SERVICE_H_
« no previous file with comments | « remoting/client/ios/facade/host_list_fetcher.cc ('k') | remoting/client/ios/facade/remoting_service.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698