2019-06-28 14:21:44 +02:00
|
|
|
using System;
|
2022-06-08 19:24:01 +02:00
|
|
|
using Bit.App.Controls;
|
|
|
|
using Bit.iOS.Core.Utilities;
|
2019-06-28 14:21:44 +02:00
|
|
|
using UIKit;
|
|
|
|
|
|
|
|
namespace Bit.iOS.Autofill
|
|
|
|
{
|
2022-06-08 19:24:01 +02:00
|
|
|
public partial class LockPasswordViewController : Core.Controllers.BaseLockPasswordViewController
|
2019-06-28 14:21:44 +02:00
|
|
|
{
|
2022-06-08 19:24:01 +02:00
|
|
|
AccountSwitchingOverlayView _accountSwitchingOverlayView;
|
|
|
|
AccountSwitchingOverlayHelper _accountSwitchingOverlayHelper;
|
|
|
|
|
|
|
|
public override UITableView TableView => MainTableView;
|
|
|
|
|
2019-06-28 14:21:44 +02:00
|
|
|
public LockPasswordViewController(IntPtr handle)
|
|
|
|
: base(handle)
|
2020-10-07 18:18:36 +02:00
|
|
|
{
|
2020-12-01 21:30:23 +01:00
|
|
|
BiometricIntegrityKey = Bit.Core.Constants.iOSAutoFillBiometricIntegrityKey;
|
2020-10-15 20:34:31 +02:00
|
|
|
DismissModalAction = Cancel;
|
2021-06-10 17:57:18 +02:00
|
|
|
autofillExtension = true;
|
2020-10-07 18:18:36 +02:00
|
|
|
}
|
2019-06-28 14:21:44 +02:00
|
|
|
|
|
|
|
public CredentialProviderViewController CPViewController { get; set; }
|
|
|
|
public override UINavigationItem BaseNavItem => NavItem;
|
|
|
|
public override UIBarButtonItem BaseCancelButton => CancelButton;
|
|
|
|
public override UIBarButtonItem BaseSubmitButton => SubmitButton;
|
|
|
|
public override Action Success => () => CPViewController.DismissLockAndContinue();
|
|
|
|
public override Action Cancel => () => CPViewController.CompleteRequest();
|
|
|
|
|
2022-06-08 19:24:01 +02:00
|
|
|
public override async void ViewDidLoad()
|
|
|
|
{
|
|
|
|
base.ViewDidLoad();
|
|
|
|
|
|
|
|
_accountSwitchingOverlayHelper = new AccountSwitchingOverlayHelper();
|
|
|
|
AccountSwitchingBarButton.Image = await _accountSwitchingOverlayHelper.CreateAvatarImageAsync();
|
|
|
|
|
|
|
|
_accountSwitchingOverlayView = _accountSwitchingOverlayHelper.CreateAccountSwitchingOverlayView(OverlayView);
|
|
|
|
}
|
|
|
|
|
|
|
|
partial void AccountSwitchingBarButton_Activated(UIBarButtonItem sender)
|
|
|
|
{
|
|
|
|
_accountSwitchingOverlayHelper.OnToolbarItemActivated(_accountSwitchingOverlayView, OverlayView);
|
|
|
|
}
|
|
|
|
|
2019-06-28 14:21:44 +02:00
|
|
|
partial void SubmitButton_Activated(UIBarButtonItem sender)
|
|
|
|
{
|
|
|
|
var task = CheckPasswordAsync();
|
|
|
|
}
|
|
|
|
|
|
|
|
partial void CancelButton_Activated(UIBarButtonItem sender)
|
|
|
|
{
|
|
|
|
Cancel();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|