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

Side by Side Diff: remoting/client/ios/domain/user_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 unified diff | Download patch
« no previous file with comments | « remoting/client/ios/domain/user_info.h ('k') | remoting/client/ios/facade/BUILD.gn » ('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 2017 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/client/ios/domain/user_info.h"
10
11 @implementation UserInfo
12
13 @synthesize userId = _userId;
14 @synthesize userFullName = _userFullName;
15 @synthesize userEmail = _userEmail;
16 @synthesize refreshToken = _refreshToken;
17
18 // Parse jsonData into Host list.
19 + (UserInfo*)parseListFromJSON:(NSMutableData*)data {
20 NSError* error;
21
22 NSDictionary* json = [NSJSONSerialization JSONObjectWithData:data
23 options:kNilOptions
24 error:&error];
25
26 UserInfo* user = [[UserInfo alloc] init];
27 user.userId = [json objectForKey:@"userId"];
28 user.userFullName = [json objectForKey:@"userFullName"];
29 user.userEmail = [json objectForKey:@"userEmail"];
30 user.refreshToken = [json objectForKey:@"refreshToken"];
31
32 return user;
33 }
34
35 - (BOOL)isAuthenticated {
36 if (_userEmail && _userEmail.length > 0 && _refreshToken &&
37 _refreshToken.length > 0) {
38 return YES;
39 }
40 return NO;
41 }
42
43 - (NSComparisonResult)compare:(UserInfo*)user {
44 return [self.userId compare:user.userId];
45 }
46
47 - (NSString*)description {
48 return [NSString stringWithFormat:@"UserInfo: userEmail=%@ refreshToken=%@",
49 _userEmail, _refreshToken];
50 }
51
52 @end
OLDNEW
« no previous file with comments | « remoting/client/ios/domain/user_info.h ('k') | remoting/client/ios/facade/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698