Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/chrome/browser/ui/commands/show_signin_command.h" | 5 #import "ios/chrome/browser/ui/commands/show_signin_command.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ios/chrome/browser/ui/commands/ios_command_ids.h" | 8 #include "ios/chrome/browser/ui/commands/ios_command_ids.h" |
| 9 | 9 |
| 10 #if !defined(__has_feature) || !__has_feature(objc_arc) | 10 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 11 #error "This file requires ARC support." | 11 #error "This file requires ARC support." |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 @implementation ShowSigninCommand | 14 @implementation ShowSigninCommand |
| 15 | 15 |
| 16 @synthesize operation = _operation; | 16 @synthesize operation = _operation; |
| 17 @synthesize identity = _identity; | |
| 17 @synthesize accessPoint = _accessPoint; | 18 @synthesize accessPoint = _accessPoint; |
| 18 @synthesize promoAction = _promoAction; | 19 @synthesize promoAction = _promoAction; |
| 19 @synthesize callback = _callback; | 20 @synthesize callback = _callback; |
| 20 | 21 |
| 21 - (instancetype)initWithTag:(NSInteger)tag { | 22 - (instancetype)initWithTag:(NSInteger)tag { |
| 22 NOTREACHED(); | 23 NOTREACHED(); |
| 23 return nil; | 24 return nil; |
| 24 } | 25 } |
| 25 | 26 |
| 26 - (instancetype)initWithOperation:(AuthenticationOperation)operation | 27 - (instancetype)initWithOperation:(AuthenticationOperation)operation |
| 28 identity:(ChromeIdentity*)identity | |
| 27 accessPoint:(signin_metrics::AccessPoint)accessPoint | 29 accessPoint:(signin_metrics::AccessPoint)accessPoint |
| 28 promoAction:(signin_metrics::PromoAction)promoAction | 30 promoAction:(signin_metrics::PromoAction)promoAction |
| 29 callback: | 31 callback: |
| 30 (ShowSigninCommandCompletionCallback)callback { | 32 (ShowSigninCommandCompletionCallback)callback { |
| 31 if ((self = [super initWithTag:IDC_SHOW_SIGNIN_IOS])) { | 33 if ((self = [super initWithTag:IDC_SHOW_SIGNIN_IOS])) { |
| 32 _operation = operation; | 34 _operation = operation; |
|
sdefresne
2017/05/17 08:49:01
Can you add a DCHECK to ensure the invariant that
jlebel
2017/05/17 12:17:37
Done.
| |
| 35 _identity = identity; | |
| 33 _accessPoint = accessPoint; | 36 _accessPoint = accessPoint; |
| 34 _promoAction = promoAction; | 37 _promoAction = promoAction; |
| 35 _callback = [callback copy]; | 38 _callback = [callback copy]; |
| 36 } | 39 } |
| 37 return self; | 40 return self; |
| 38 } | 41 } |
| 39 | 42 |
| 40 - (instancetype)initWithOperation:(AuthenticationOperation)operation | 43 - (instancetype)initWithOperation:(AuthenticationOperation)operation |
| 41 accessPoint:(signin_metrics::AccessPoint)accessPoint | 44 accessPoint:(signin_metrics::AccessPoint)accessPoint |
| 42 promoAction:(signin_metrics::PromoAction)promoAction { | 45 promoAction:(signin_metrics::PromoAction)promoAction { |
| 43 return [self initWithOperation:operation | 46 return [self initWithOperation:operation |
| 47 identity:nil | |
| 44 accessPoint:accessPoint | 48 accessPoint:accessPoint |
| 45 promoAction:promoAction | 49 promoAction:promoAction |
| 46 callback:nil]; | 50 callback:nil]; |
| 47 } | 51 } |
| 48 | 52 |
| 49 @end | 53 @end |
| OLD | NEW |