Index: remoting/ios/host_refresh.h |
diff --git a/remoting/ios/host_refresh.h b/remoting/ios/host_refresh.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b3555e9a62532f9902abaafc2015f61e9bd7f03b |
--- /dev/null |
+++ b/remoting/ios/host_refresh.h |
@@ -0,0 +1,49 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef REMOTING_IOS_HOST_REFRESH_H_ |
+#define REMOTING_IOS_HOST_REFRESH_H_ |
+ |
+#import <Foundation/Foundation.h> |
+ |
+#include "google_apis/google_api_keys.h" |
+// TODO (aboone) Pulling in some service values from the host side. The cc's |
+// are also compiled as part of this project because the target remoting_host |
+// does not build on iOS right now. |
+#include "remoting/host/setup/oauth_helper.h" |
+#include "remoting/host/service_urls.h" |
+ |
+#import "GTMOAuth2Authentication.h" |
+ |
+namespace { |
+static NSString* const kKeychainItemName = @"Google Chromoting iOS"; |
+} // namespace |
+ |
+// HostRefresh encapulates a fetch of the Chromoting hostlist from |
+// the jabber service. |
+ |
+// Contract to handle the hostlist result of a Chromoting hostlist fetch. |
+@protocol HostRefreshDelegate<NSObject> |
+ |
+- (void)hostListRefresh:(NSArray*)hostList; |
+ |
+@end |
+ |
+// Fetches the host list from the jabber service async. Authenticates, |
+// and parses the results to provide to a HostListViewController |
+@interface HostRefresh : NSObject<NSURLConnectionDataDelegate> { |
+ @private |
+ // Store data read while the connection is active, and can be used after the |
+ // connection has been discarded |
+ NSMutableData* _jsonData; |
+ |
+ id<HostRefreshDelegate> _delegate; |
+} |
+ |
+- (void)refreshHostList:(GTMOAuth2Authentication*)authReq |
+ delegate:(id<HostRefreshDelegate>)delegate; |
+ |
+@end |
+ |
+#endif // REMOTING_IOS_HOST_REFRESH_H_ |