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

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

Issue 2681173002: Adding domain and facade supporting classes for remoting iOS app. (Closed)
Patch Set: Renaming access code to authorization code per spec language. Created 3 years, 10 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
Index: remoting/client/ios/domain/user.mm
diff --git a/remoting/client/ios/domain/user.mm b/remoting/client/ios/domain/user.mm
new file mode 100644
index 0000000000000000000000000000000000000000..92b6fefe23bf6de389939aa6fa0a1a31dd88f78d
--- /dev/null
+++ b/remoting/client/ios/domain/user.mm
@@ -0,0 +1,37 @@
+// Copyright 2017 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/user.h"
+
+@implementation User
+
+@synthesize userId = _userId;
+@synthesize userFullName = _userFullName;
+@synthesize userEmail = _userEmail;
+
+// Parse jsonData into Host list.
++ (User*)parseListFromJSON:(NSMutableData*)data {
+ NSError* error;
+
+ NSDictionary* json = [NSJSONSerialization JSONObjectWithData:data
+ options:kNilOptions
+ error:&error];
+
+ User* user = [[User alloc] init];
+ user.userId = [json objectForKey:@"userId"];
+ user.userFullName = [json objectForKey:@"userFullName"];
+ user.userEmail = [json objectForKey:@"userEmail"];
+
+ return user;
+}
+
+- (NSComparisonResult)compare:(User*)user {
+ return [self.userId compare:user.userId];
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698