Chromium Code Reviews| 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 [[[[self class] alloc] initWithEmail:email gaiaID:gaiaID name:name] | |
|
sdefresne
2016/07/07 12:12:40
Do we subclass FakeChromeIdentify? If not, the [se
bzanotti
2016/07/07 12:48:11
Done.
| |
| 20 autorelease]; | |
| 21 } | |
| 22 | |
| 23 - (instancetype)initWithEmail:(NSString*)email | |
| 24 gaiaID:(NSString*)gaiaID | |
| 25 name:(NSString*)name { | |
| 26 self = [super init]; | |
| 27 if (self) { | |
| 28 _userEmail.reset([email copy]); | |
| 29 _gaiaID.reset([gaiaID copy]); | |
| 30 _userFullName.reset([name copy]); | |
| 31 _hashedGaiaID.reset( | |
| 32 [[NSString stringWithFormat:@"%@_hashID", name] retain]); | |
| 33 } | |
| 34 return self; | |
| 35 } | |
| 36 | |
| 37 - (NSString*)userEmail { | |
| 38 return _userEmail; | |
| 39 } | |
| 40 | |
| 41 - (NSString*)gaiaID { | |
| 42 return _gaiaID; | |
| 43 } | |
| 44 | |
| 45 - (NSString*)userFullName { | |
| 46 return _userFullName; | |
| 47 } | |
| 48 | |
| 49 - (NSString*)hashedGaiaID { | |
| 50 return _hashedGaiaID; | |
| 51 } | |
| 52 | |
| 53 @end | |
| OLD | NEW |