1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-19 11:06:01 +01:00
bitwarden-mobile/src/iOS.Autofill/LockPasswordViewController.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
2.0 KiB
C#
Raw Normal View History

2019-06-28 14:21:44 +02:00
using System;
using Bit.App.Controls;
using Bit.iOS.Core.Utilities;
2019-06-28 14:21:44 +02:00
using UIKit;
namespace Bit.iOS.Autofill
{
public partial class LockPasswordViewController : Core.Controllers.BaseLockPasswordViewController
2019-06-28 14:21:44 +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)
{
BiometricIntegrityKey = Bit.Core.Constants.iOSAutoFillBiometricIntegrityKey;
DismissModalAction = Cancel;
2021-06-10 17:57:18 +02:00
autofillExtension = true;
}
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();
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();
}
}
}