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 #ifndef IOS_CHROME_BROWSER_UI_COMMANDS_SHOW_SIGNIN_COMMAND_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_COMMANDS_SHOW_SIGNIN_COMMAND_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_COMMANDS_SHOW_SIGNIN_COMMAND_H_ | 6 #define IOS_CHROME_BROWSER_UI_COMMANDS_SHOW_SIGNIN_COMMAND_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 #include "components/signin/core/browser/signin_metrics.h" | 10 #include "components/signin/core/browser/signin_metrics.h" |
| 11 #include "ios/chrome/browser/ui/commands/generic_chrome_command.h" | 11 #include "ios/chrome/browser/ui/commands/generic_chrome_command.h" |
| 12 | 12 |
| 13 @class ChromeIdentity; | |
| 14 | |
| 13 typedef void (^ShowSigninCommandCompletionCallback)(BOOL succeeded); | 15 typedef void (^ShowSigninCommandCompletionCallback)(BOOL succeeded); |
| 14 | 16 |
| 15 enum AuthenticationOperation { | 17 enum AuthenticationOperation { |
| 16 // Operation to cancel the current authentication operation and dismiss any | 18 // Operation to cancel the current authentication operation and dismiss any |
| 17 // UI presented by this operation. | 19 // UI presented by this operation. |
| 18 AUTHENTICATION_OPERATION_DISMISS, | 20 AUTHENTICATION_OPERATION_DISMISS, |
| 19 | 21 |
| 20 // Operation to start a re-authenticate operation. The user is presented with | 22 // Operation to start a re-authenticate operation. The user is presented with |
| 21 // the SSOAuth re-authenticate web page. | 23 // the SSOAuth re-authenticate web page. |
| 22 AUTHENTICATION_OPERATION_REAUTHENTICATE, | 24 AUTHENTICATION_OPERATION_REAUTHENTICATE, |
| 23 | 25 |
| 24 // Operation to start a sign-in operation. The user is presented with the | 26 // Operation to start a sign-in operation. The user is presented with the |
| 25 // SSOAuth sign in page (SSOAuth account picker or SSOAuth sign-in web page). | 27 // SSOAuth sign in page (SSOAuth account picker or SSOAuth sign-in web page). |
| 26 AUTHENTICATION_OPERATION_SIGNIN, | 28 AUTHENTICATION_OPERATION_SIGNIN, |
| 27 | |
| 28 // Operation to start a sign-in operation based on the first known identity. | |
| 29 // The users are presented with the sync confirmation screen. | |
| 30 AUTHENTICATION_OPERATION_SIGNIN_PROMO_CONTINUE_AS, | |
| 31 }; | 29 }; |
| 32 | 30 |
| 33 // A command to perform a sign in operation. | 31 // A command to perform a sign in operation. |
| 34 @interface ShowSigninCommand : GenericChromeCommand | 32 @interface ShowSigninCommand : GenericChromeCommand |
| 35 | 33 |
| 36 // Mark inherited initializer as unavailable to prevent calling it by mistake. | 34 // Mark inherited initializer as unavailable to prevent calling it by mistake. |
| 37 - (instancetype)initWithTag:(NSInteger)tag NS_UNAVAILABLE; | 35 - (instancetype)initWithTag:(NSInteger)tag NS_UNAVAILABLE; |
| 38 | 36 |
| 39 // Initializes a command to perform the specified operation with a | 37 // Initializes a command to perform the specified operation with a |
| 40 // SigninInteractionController and invoke a possibly-nil callback when finished. | 38 // SigninInteractionController and invoke a possibly-nil callback when finished. |
| 41 - (instancetype)initWithOperation:(AuthenticationOperation)operation | 39 - (instancetype)initWithOperation:(AuthenticationOperation)operation |
| 40 identity:(ChromeIdentity*)identity | |
| 42 accessPoint:(signin_metrics::AccessPoint)accessPoint | 41 accessPoint:(signin_metrics::AccessPoint)accessPoint |
| 43 promoAction:(signin_metrics::PromoAction)promoAction | 42 promoAction:(signin_metrics::PromoAction)promoAction |
| 44 callback:(ShowSigninCommandCompletionCallback)callback | 43 callback:(ShowSigninCommandCompletionCallback)callback |
| 45 NS_DESIGNATED_INITIALIZER; | 44 NS_DESIGNATED_INITIALIZER; |
| 46 | 45 |
| 47 // Initializes a ShowSigninCommand with a nil callback. | 46 // Initializes a ShowSigninCommand with |identity| and |callback| set to nil. |
| 48 - (instancetype)initWithOperation:(AuthenticationOperation)operation | 47 - (instancetype)initWithOperation:(AuthenticationOperation)operation |
| 49 accessPoint:(signin_metrics::AccessPoint)accessPoint | 48 accessPoint:(signin_metrics::AccessPoint)accessPoint |
| 50 promoAction:(signin_metrics::PromoAction)promoAction; | 49 promoAction:(signin_metrics::PromoAction)promoAction; |
| 51 | 50 |
| 52 // The callback to be invoked after the operation is complete. | 51 // The callback to be invoked after the operation is complete. |
| 53 @property(copy, nonatomic, readonly) | 52 @property(copy, nonatomic, readonly) |
| 54 ShowSigninCommandCompletionCallback callback; | 53 ShowSigninCommandCompletionCallback callback; |
| 55 | 54 |
| 56 // The operation to perform during the sign-in flow. | 55 // The operation to perform during the sign-in flow. |
| 57 @property(nonatomic, readonly) AuthenticationOperation operation; | 56 @property(nonatomic, readonly) AuthenticationOperation operation; |
| 58 | 57 |
| 58 // Chrome identity used to sign-in when the operation is | |
| 59 // AUTHENTICATION_OPERATION_SIGNIN_PROMO_CONTINUE_AS (|identity should not be | |
|
sdefresne
2017/05/17 08:49:01
You are removing the "AUTHENTICATION_OPERATION_SIG
jlebel
2017/05/17 12:17:37
Done.
| |
| 60 // nil). For other operation, |identity| should be nil. | |
| 61 @property(nonatomic, readonly) ChromeIdentity* identity; | |
| 62 | |
| 59 // The access point of this authentication operation. | 63 // The access point of this authentication operation. |
| 60 @property(nonatomic, readonly) signin_metrics::AccessPoint accessPoint; | 64 @property(nonatomic, readonly) signin_metrics::AccessPoint accessPoint; |
| 61 | 65 |
| 62 // The user action from the sign-in promo to trigger the sign-in operation. | 66 // The user action from the sign-in promo to trigger the sign-in operation. |
| 63 @property(nonatomic, readonly) signin_metrics::PromoAction promoAction; | 67 @property(nonatomic, readonly) signin_metrics::PromoAction promoAction; |
| 64 | 68 |
| 65 @end | 69 @end |
| 66 | 70 |
| 67 #endif // IOS_CHROME_BROWSER_UI_COMMANDS_SHOW_SIGNIN_COMMAND_H_ | 71 #endif // IOS_CHROME_BROWSER_UI_COMMANDS_SHOW_SIGNIN_COMMAND_H_ |
| OLD | NEW |