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

Side by Side Diff: ios/chrome/browser/ui/commands/show_signin_command.h

Issue 2880333003: Adding ChromeIdentity in ShowSigninCommand. (Closed)
Patch Set: Fixing the build Created 3 years, 7 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
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 // Initializes a ShowSigninCommand with PROMO_ACTION_NO_SIGNIN_PROMO and a nil 51 // Initializes a ShowSigninCommand with PROMO_ACTION_NO_SIGNIN_PROMO and a nil
53 // callback. 52 // callback.
54 - (instancetype)initWithOperation:(AuthenticationOperation)operation 53 - (instancetype)initWithOperation:(AuthenticationOperation)operation
55 accessPoint:(signin_metrics::AccessPoint)accessPoint; 54 accessPoint:(signin_metrics::AccessPoint)accessPoint;
56 55
57 // The callback to be invoked after the operation is complete. 56 // The callback to be invoked after the operation is complete.
58 @property(copy, nonatomic, readonly) 57 @property(copy, nonatomic, readonly)
59 ShowSigninCommandCompletionCallback callback; 58 ShowSigninCommandCompletionCallback callback;
60 59
61 // The operation to perform during the sign-in flow. 60 // The operation to perform during the sign-in flow.
62 @property(nonatomic, readonly) AuthenticationOperation operation; 61 @property(nonatomic, readonly) AuthenticationOperation operation;
63 62
63 // Chrome identity is only used for the AUTHENTICATION_OPERATION_SIGNIN
64 // operation (should be nil otherwise). If the identity is non-nil, the
65 // interaction view controller logins using this identity. If the identity is
66 // nil, the interaction view controller asks the user to choose an identity or
67 // to add a new one.
68 @property(nonatomic, readonly) ChromeIdentity* identity;
69
64 // The access point of this authentication operation. 70 // The access point of this authentication operation.
65 @property(nonatomic, readonly) signin_metrics::AccessPoint accessPoint; 71 @property(nonatomic, readonly) signin_metrics::AccessPoint accessPoint;
66 72
67 // The user action from the sign-in promo to trigger the sign-in operation. 73 // The user action from the sign-in promo to trigger the sign-in operation.
68 @property(nonatomic, readonly) signin_metrics::PromoAction promoAction; 74 @property(nonatomic, readonly) signin_metrics::PromoAction promoAction;
69 75
70 @end 76 @end
71 77
72 #endif // IOS_CHROME_BROWSER_UI_COMMANDS_SHOW_SIGNIN_COMMAND_H_ 78 #endif // IOS_CHROME_BROWSER_UI_COMMANDS_SHOW_SIGNIN_COMMAND_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698