OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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 #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h" | |
6 | |
7 #import "base/mac/scoped_nsobject.h" | |
8 | |
9 @implementation FakeChromeIdentity { | |
10 base::scoped_nsobject<NSString> _userEmail; | |
11 base::scoped_nsobject<NSString> _gaiaID; | |
12 base::scoped_nsobject<NSString> _userFullName; | |
13 base::scoped_nsobject<NSString> _hashedGaiaID; | |
14 } | |
15 | |
16 + (FakeChromeIdentity*)identityWithEmail:(NSString*)email | |
17 gaiaID:(NSString*)gaiaID | |
18 name:(NSString*)name { | |
19 return | |
20 [[[FakeChromeIdentity alloc] initWithEmail:email gaiaID:gaiaID name:name] | |
21 autorelease]; | |
22 } | |
23 | |
24 - (instancetype)initWithEmail:(NSString*)email | |
25 gaiaID:(NSString*)gaiaID | |
26 name:(NSString*)name { | |
27 self = [super init]; | |
28 if (self) { | |
29 _userEmail.reset([email copy]); | |
30 _gaiaID.reset([gaiaID copy]); | |
31 _userFullName.reset([name copy]); | |
32 _hashedGaiaID.reset( | |
33 [[NSString stringWithFormat:@"%@_hashID", name] retain]); | |
sdefresne
2016/07/07 12:58:02
nit: retain -> copy?
bzanotti
2016/07/07 13:09:32
Why? This would be a useless copy as stringWithFor
| |
34 } | |
35 return self; | |
36 } | |
37 | |
38 - (NSString*)userEmail { | |
39 return _userEmail; | |
40 } | |
41 | |
42 - (NSString*)gaiaID { | |
43 return _gaiaID; | |
44 } | |
45 | |
46 - (NSString*)userFullName { | |
47 return _userFullName; | |
48 } | |
49 | |
50 - (NSString*)hashedGaiaID { | |
51 return _hashedGaiaID; | |
52 } | |
53 | |
54 @end | |
OLD | NEW |