2019-06-28 15:21:44 +03:00
|
|
|
using System;
|
2022-06-08 20:24:01 +03:00
|
|
|
using Bit.App.Controls;
|
2023-06-13 23:38:08 +03:00
|
|
|
using Bit.Core.Utilities;
|
2022-06-08 20:24:01 +03:00
|
|
|
using Bit.iOS.Core.Utilities;
|
2019-06-28 15:21:44 +03:00
|
|
|
using UIKit;
|
|
|
|
|
|
|
|
namespace Bit.iOS.Autofill
|
|
|
|
{
|
2022-06-08 20:24:01 +03:00
|
|
|
public partial class LockPasswordViewController : Core.Controllers.BaseLockPasswordViewController
|
2019-06-28 15:21:44 +03:00
|
|
|
{
|
2022-06-08 20:24:01 +03:00
|
|
|
AccountSwitchingOverlayView _accountSwitchingOverlayView;
|
|
|
|
AccountSwitchingOverlayHelper _accountSwitchingOverlayHelper;
|
|
|
|
|
|
|
|
public override UITableView TableView => MainTableView;
|
|
|
|
|
2019-06-28 15:21:44 +03:00
|
|
|
public LockPasswordViewController(IntPtr handle)
|
|
|
|
: base(handle)
|
2020-10-07 19:18:36 +03:00
|
|
|
{
|
2023-05-01 16:47:00 +03:00
|
|
|
BiometricIntegritySourceKey = Bit.Core.Constants.iOSAutoFillBiometricIntegritySourceKey;
|
2020-10-15 21:34:31 +03:00
|
|
|
DismissModalAction = Cancel;
|
2021-06-10 18:57:18 +03:00
|
|
|
autofillExtension = true;
|
2020-10-07 19:18:36 +03:00
|
|
|
}
|
2019-06-28 15:21:44 +03: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 20:24:01 +03: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 15:21:44 +03:00
|
|
|
partial void SubmitButton_Activated(UIBarButtonItem sender)
|
|
|
|
{
|
2023-06-13 23:38:08 +03:00
|
|
|
CheckPasswordAsync().FireAndForget();
|
2019-06-28 15:21:44 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
partial void CancelButton_Activated(UIBarButtonItem sender)
|
|
|
|
{
|
|
|
|
Cancel();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|