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

Unified Diff: remoting/client/ios/domain/host_info.mm

Issue 2871993003: Moving the iOS directory to be remoting top level. (Closed)
Patch Set: //remoting/ios was the old landing target for the internal iOS application. Fix. 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
« no previous file with comments | « remoting/client/ios/domain/host_info.h ('k') | remoting/client/ios/domain/user_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/ios/domain/host_info.mm
diff --git a/remoting/client/ios/domain/host_info.mm b/remoting/client/ios/domain/host_info.mm
deleted file mode 100644
index b90c0652ac8bd09cbeb743bb4a38a2234b04f9bd..0000000000000000000000000000000000000000
--- a/remoting/client/ios/domain/host_info.mm
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2016 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.
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-#import "remoting/client/ios/domain/host_info.h"
-
-@implementation HostInfo
-
-@synthesize createdTime = _createdTime;
-@synthesize hostId = _hostId;
-@synthesize hostName = _hostName;
-@synthesize hostVersion = _hostVersion;
-@synthesize jabberId = _jabberId;
-@synthesize kind = _kind;
-@synthesize publicKey = _publicKey;
-@synthesize status = _status;
-@synthesize updatedTime = _updatedTime;
-@synthesize isOnline = _isOnline;
-
-- (bool)isOnline {
- _isOnline = (self.status && [self.status isEqualToString:@"ONLINE"]);
- return _isOnline;
-}
-
-// 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.hostVersion = [svr objectForKey:@"hostVersion"];
- 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 {
- if (self.isOnline != host.isOnline) {
- return self.isOnline ? NSOrderedAscending : NSOrderedDescending;
- } else {
- return [self.hostName localizedCaseInsensitiveCompare:host.hostName];
- }
-}
-
-- (NSString*)description {
- return
- [NSString stringWithFormat:@"HostInfo: name=%@ status=%@ updatedTime= %@",
- _hostName, _status, _updatedTime];
-}
-
-@end
« no previous file with comments | « remoting/client/ios/domain/host_info.h ('k') | remoting/client/ios/domain/user_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698