Commit 6316b52f authored by Yuwei Huang's avatar Yuwei Huang Committed by Commit Bot

[CRD iOS] Cleaning up dead code

These code are no longer used and can be removed.

Bug: 786616
Change-Id: I81782e7935026d36c9d3207da4db11c80057e3bf
Reviewed-on: https://chromium-review.googlesource.com/780585Reviewed-by: default avatarJamie Walch <jamiewalch@chromium.org>
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518365}
parent e12ad082
...@@ -297,14 +297,6 @@ ConnectionType GetConnectionType() { ...@@ -297,14 +297,6 @@ ConnectionType GetConnectionType() {
#pragma mark - UIViewControllerTransitioningDelegate #pragma mark - UIViewControllerTransitioningDelegate
- (nullable id<UIViewControllerAnimatedTransitioning>)
animationControllerForPresentedController:(UIViewController*)presented
presentingController:(UIViewController*)presenting
sourceController:(UIViewController*)source {
// TODO(nicholss): Not implemented yet.
return nil;
}
- (nullable id<UIViewControllerAnimatedTransitioning>) - (nullable id<UIViewControllerAnimatedTransitioning>)
animationControllerForDismissedController:(UIViewController*)dismissed { animationControllerForDismissedController:(UIViewController*)dismissed {
return self; return self;
......
...@@ -26,10 +26,6 @@ ...@@ -26,10 +26,6 @@
// True when |status| is @"ONLINE", anything else is False. // True when |status| is @"ONLINE", anything else is False.
@property(nonatomic, readonly) bool isOnline; @property(nonatomic, readonly) bool isOnline;
// Convert a json blob into a |HostInfo| object. Most useful for test.
// TODO(yuweih): This method seems to be unused. Remove it.
+ (NSMutableArray<HostInfo*>*)parseListFromJSON:(NSMutableData*)data;
// First consider if |isOnline| is greater than anything else, then consider by // First consider if |isOnline| is greater than anything else, then consider by
// case insensitive locale of |hostName|. // case insensitive locale of |hostName|.
- (NSComparisonResult)compare:(HostInfo*)host; - (NSComparisonResult)compare:(HostInfo*)host;
......
...@@ -27,47 +27,6 @@ ...@@ -27,47 +27,6 @@
return (self.status && [self.status isEqualToString:@"ONLINE"]); return (self.status && [self.status isEqualToString:@"ONLINE"]);
} }
// Parse jsonData into Host list.
+ (NSMutableArray<HostInfo*>*)parseListFromJSON:(NSMutableData*)data {
NSError* error;
NSDictionary* json = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:&error];
NSDictionary* dataDict = [json objectForKey:@"data"];
NSArray* availableHosts = [dataDict objectForKey:@"items"];
NSMutableArray* hostList = [[NSMutableArray alloc] init];
NSUInteger idx = 0;
NSDictionary* svr;
NSUInteger count = [availableHosts count];
while (idx < count) {
svr = [availableHosts objectAtIndex:idx++];
HostInfo* host = [[HostInfo alloc] init];
host.createdTime = [svr objectForKey:@"createdTime"];
host.hostId = [svr objectForKey:@"hostId"];
host.hostName = [svr objectForKey:@"hostName"];
host.hostOs = [svr objectForKey:@"hostOs"];
host.hostVersion = [svr objectForKey:@"hostVersion"];
host.hostOsVersion = [svr objectForKey:@"hostOsVersion"];
host.jabberId = [svr objectForKey:@"jabberId"];
host.kind = [svr objectForKey:@"kind"];
host.publicKey = [svr objectForKey:@"publicKey"];
host.status = [svr objectForKey:@"status"];
// NSString* ISO8601DateString = [svr objectForKey:@"updatedTime"];
// if (ISO8601DateString != nil) {
// NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
// [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSSz"];
// host.updatedTime = [dateFormatter dateFromString:ISO8601DateString];
// }
[hostList addObject:host];
}
return hostList;
}
- (NSComparisonResult)compare:(HostInfo*)host { - (NSComparisonResult)compare:(HostInfo*)host {
if (self.isOnline != host.isOnline) { if (self.isOnline != host.isOnline) {
return self.isOnline ? NSOrderedAscending : NSOrderedDescending; return self.isOnline ? NSOrderedAscending : NSOrderedDescending;
......
...@@ -18,10 +18,6 @@ ...@@ -18,10 +18,6 @@
// decide whether the UserInfo is authenticated. // decide whether the UserInfo is authenticated.
@property(nonatomic, copy) NSString* refreshToken; @property(nonatomic, copy) NSString* refreshToken;
// Convert a json blob into a |UserInfo| object. Most useful for test.
// TODO(nicholss): Might move this out into a catagory.
+ (UserInfo*)parseListFromJSON:(NSMutableData*)data;
// This returns the authenticated state of the this user info object. // This returns the authenticated state of the this user info object.
- (BOOL)isAuthenticated; - (BOOL)isAuthenticated;
// Compare two |UserInfo| objects. // Compare two |UserInfo| objects.
......
...@@ -15,23 +15,6 @@ ...@@ -15,23 +15,6 @@
@synthesize userEmail = _userEmail; @synthesize userEmail = _userEmail;
@synthesize refreshToken = _refreshToken; @synthesize refreshToken = _refreshToken;
// Parse jsonData into Host list.
+ (UserInfo*)parseListFromJSON:(NSMutableData*)data {
NSError* error;
NSDictionary* json = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:&error];
UserInfo* user = [[UserInfo alloc] init];
user.userId = [json objectForKey:@"userId"];
user.userFullName = [json objectForKey:@"userFullName"];
user.userEmail = [json objectForKey:@"userEmail"];
user.refreshToken = [json objectForKey:@"refreshToken"];
return user;
}
- (BOOL)isAuthenticated { - (BOOL)isAuthenticated {
if (_userEmail && _userEmail.length > 0 && _refreshToken && if (_userEmail && _userEmail.length > 0 && _refreshToken &&
_refreshToken.length > 0) { _refreshToken.length > 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment