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

Side by Side Diff: remoting/ios/host.mm

Issue 475333004: Remove old Chromoting iOS client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « remoting/ios/host.h ('k') | remoting/ios/host_cell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #if !defined(__has_feature) || !__has_feature(objc_arc)
6 #error "This file requires ARC support."
7 #endif
8
9 #import "remoting/ios/host.h"
10
11 @implementation Host
12
13 @synthesize createdTime = _createdTime;
14 @synthesize hostId = _hostId;
15 @synthesize hostName = _hostName;
16 @synthesize hostVersion = _hostVersion;
17 @synthesize jabberId = _jabberId;
18 @synthesize kind = _kind;
19 @synthesize publicKey = _publicKey;
20 @synthesize status = _status;
21 @synthesize updatedTime = _updatedTime;
22
23 // Parse jsonData into Host list
24 + (NSMutableArray*)parseListFromJSON:(NSMutableData*)data {
25 NSError* error;
26
27 NSDictionary* json = [NSJSONSerialization JSONObjectWithData:data
28 options:kNilOptions
29 error:&error];
30
31 NSDictionary* dataDict = [json objectForKey:@"data"];
32
33 NSArray* availableServers = [dataDict objectForKey:@"items"];
34
35 NSMutableArray* serverList = [[NSMutableArray alloc] init];
36
37 NSUInteger idx = 0;
38 NSDictionary* svr;
39 NSUInteger count = [availableServers count];
40
41 while (idx < count) {
42 svr = [availableServers objectAtIndex:idx++];
43 Host* host = [[Host alloc] init];
44 host.createdTime = [svr objectForKey:@"createdTime"];
45 host.hostId = [svr objectForKey:@"hostId"];
46 host.hostName = [svr objectForKey:@"hostName"];
47 host.hostVersion = [svr objectForKey:@"hostVersion"];
48 host.jabberId = [svr objectForKey:@"jabberId"];
49 host.kind = [svr objectForKey:@"kind"];
50 host.publicKey = [svr objectForKey:@"publicKey"];
51 host.status = [svr objectForKey:@"status"];
52 host.updatedTime = [svr objectForKey:@"updatedTime"];
53 [serverList addObject:host];
54 }
55
56 return serverList;
57 }
58
59 @end
OLDNEW
« no previous file with comments | « remoting/ios/host.h ('k') | remoting/ios/host_cell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698