OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_INTERACTION_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_INTERACTION_CONTROLLER_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 #import "base/ios/block_types.h" |
| 11 #include "components/signin/core/browser/signin_metrics.h" |
| 12 #include "ios/chrome/browser/signin/constants.h" |
| 13 |
| 14 namespace ios { |
| 15 class ChromeBrowserState; |
| 16 } |
| 17 |
| 18 // Interaction controller for sign-in related operations. This class is mainly a |
| 19 // proxy for |ChromeSigninViewController|, calling directly |
| 20 // |ChromeIdentityInteractionManager| for the no-accounts case. |
| 21 @interface SigninInteractionController : NSObject |
| 22 |
| 23 // Designated initializer. |
| 24 // * |browserState| is the current browser state |
| 25 // * |presentingViewController| is the top presented view controller. |
| 26 // * |isPresentedOnSettings| indicates whether the settings view controller is |
| 27 // part of the presented view controllers stack |
| 28 // * |accessPoint| represents the access point that initiated the sign-in. |
| 29 - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState |
| 30 presentingViewController:(UIViewController*)presentingViewController |
| 31 isPresentedOnSettings:(BOOL)isPresentedOnSettings |
| 32 signInAccessPoint:(signin_metrics::AccessPoint)accessPoint; |
| 33 |
| 34 // Starts user sign-in. The completion block will be called when the operation |
| 35 // is done, and |succeeded| will notify the caller on whether the user is now |
| 36 // signed in. |
| 37 - (void)signInWithCompletion:(signin_ui::CompletionCallback)completion |
| 38 viewController:(UIViewController*)viewController; |
| 39 |
| 40 // Re-authenticate the user. This method will always show a sign-in web flow. |
| 41 // The completion block will be called when the operation is done, and |
| 42 // |succeeded| will notify the caller on whether the user has been |
| 43 // correctly re-authenticated. |
| 44 - (void)reAuthenticateWithCompletion:(signin_ui::CompletionCallback)completion |
| 45 viewController:(UIViewController*)viewController; |
| 46 |
| 47 // Starts the flow to add an identity via ChromeIdentityInteractionManager. |
| 48 - (void)addAccountWithCompletion:(signin_ui::CompletionCallback)completion |
| 49 viewController:(UIViewController*)viewController; |
| 50 |
| 51 // Cancels any current process. Calls the completion callback when done. |
| 52 - (void)cancel; |
| 53 |
| 54 // Cancels any current process and dismisses any UI. Calls the completion |
| 55 // callback when done. |
| 56 - (void)cancelAndDismiss; |
| 57 |
| 58 @end |
| 59 |
| 60 #endif // IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_INTERACTION_CONTROLLER_H_ |
OLD | NEW |