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

Side by Side Diff: ios/public/provider/chrome/browser/signin/fake_chrome_identity.mm

Issue 2123273003: Introduce FakeChromeIdentity and FakeChromeIdentityService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698