mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-24 11:55:38 +01:00
copy classes to autofill
This commit is contained in:
parent
219af7f288
commit
d32eb9c9bc
28
src/iOS.Autofill/LockFingerprintViewController.cs
Normal file
28
src/iOS.Autofill/LockFingerprintViewController.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Extension
|
||||
{
|
||||
public partial class LockFingerprintViewController : Core.Controllers.LockFingerprintViewController
|
||||
{
|
||||
public LockFingerprintViewController(IntPtr handle) : base(handle)
|
||||
{ }
|
||||
|
||||
public LoadingViewController LoadingController { get; set; }
|
||||
public override UINavigationItem BaseNavItem => NavItem;
|
||||
public override UIBarButtonItem BaseCancelButton => CancelButton;
|
||||
public override UIButton BaseUseButton => UseButton;
|
||||
public override UIButton BaseFingerprintButton => FingerprintButton;
|
||||
public override Action Success => () => LoadingController.DismissLockAndContinue();
|
||||
|
||||
partial void CancelButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
LoadingController.CompleteRequest(null);
|
||||
}
|
||||
|
||||
partial void FingerprintButton_TouchUpInside(UIButton sender)
|
||||
{
|
||||
var task = CheckFingerprintAsync();
|
||||
}
|
||||
}
|
||||
}
|
27
src/iOS.Autofill/LockPasswordViewController.cs
Normal file
27
src/iOS.Autofill/LockPasswordViewController.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Extension
|
||||
{
|
||||
public partial class LockPasswordViewController : Core.Controllers.LockPasswordViewController
|
||||
{
|
||||
public LockPasswordViewController(IntPtr handle) : base(handle)
|
||||
{ }
|
||||
|
||||
public LoadingViewController LoadingController { get; set; }
|
||||
public override UINavigationItem BaseNavItem => NavItem;
|
||||
public override UIBarButtonItem BaseCancelButton => CancelButton;
|
||||
public override UIBarButtonItem BaseSubmitButton => SubmitButton;
|
||||
public override Action Success => () => LoadingController.DismissLockAndContinue();
|
||||
|
||||
partial void SubmitButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
CheckPassword();
|
||||
}
|
||||
|
||||
partial void CancelButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
LoadingController.CompleteRequest(null);
|
||||
}
|
||||
}
|
||||
}
|
24
src/iOS.Autofill/LockPinViewController.cs
Normal file
24
src/iOS.Autofill/LockPinViewController.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Extension
|
||||
{
|
||||
public partial class LockPinViewController : Core.Controllers.LockPinViewController
|
||||
{
|
||||
public LockPinViewController(IntPtr handle) : base(handle)
|
||||
{ }
|
||||
|
||||
public LoadingViewController LoadingController { get; set; }
|
||||
public override UINavigationItem BaseNavItem => NavItem;
|
||||
public override UIBarButtonItem BaseCancelButton => CancelButton;
|
||||
public override UILabel BasePinLabel => PinLabel;
|
||||
public override UILabel BaseInstructionLabel => InstructionLabel;
|
||||
public override UITextField BasePinTextField => PinTextField;
|
||||
public override Action Success => () => LoadingController.DismissLockAndContinue();
|
||||
|
||||
partial void CancelButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
LoadingController.CompleteRequest(null);
|
||||
}
|
||||
}
|
||||
}
|
63
src/iOS.Autofill/LoginAddViewController.cs
Normal file
63
src/iOS.Autofill/LoginAddViewController.cs
Normal file
@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Extension
|
||||
{
|
||||
public partial class LoginAddViewController : Core.Controllers.LoginAddViewController
|
||||
{
|
||||
public LoginAddViewController(IntPtr handle) : base(handle)
|
||||
{ }
|
||||
|
||||
public LoginListViewController LoginListController { get; set; }
|
||||
public LoadingViewController LoadingController { get; set; }
|
||||
|
||||
public override UINavigationItem BaseNavItem => NavItem;
|
||||
public override UIBarButtonItem BaseCancelButton => CancelBarButton;
|
||||
public override UIBarButtonItem BaseSaveButton => SaveBarButton;
|
||||
|
||||
public override Action Success => () =>
|
||||
{
|
||||
if(LoginListController != null)
|
||||
{
|
||||
LoginListController.DismissModal();
|
||||
}
|
||||
else if(LoadingController != null)
|
||||
{
|
||||
LoadingController.CompleteUsernamePasswordRequest(UsernameCell.TextField.Text,
|
||||
PasswordCell.TextField.Text, null, null);
|
||||
}
|
||||
};
|
||||
|
||||
partial void CancelBarButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
if(LoginListController != null)
|
||||
{
|
||||
DismissViewController(true, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadingController.CompleteRequest(null);
|
||||
}
|
||||
}
|
||||
|
||||
async partial void SaveBarButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
await this.SaveAsync();
|
||||
}
|
||||
|
||||
public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender)
|
||||
{
|
||||
var navController = segue.DestinationViewController as UINavigationController;
|
||||
if(navController != null)
|
||||
{
|
||||
var passwordGeneratorController = navController.TopViewController as PasswordGeneratorViewController;
|
||||
if(passwordGeneratorController != null)
|
||||
{
|
||||
passwordGeneratorController.PasswordOptions = Context.PasswordOptions;
|
||||
passwordGeneratorController.Parent = this;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
55
src/iOS.Autofill/LoginListViewController.designer.cs
generated
55
src/iOS.Autofill/LoginListViewController.designer.cs
generated
@ -1,55 +0,0 @@
|
||||
// WARNING
|
||||
//
|
||||
// This file has been generated automatically by Visual Studio from the outlets and
|
||||
// actions declared in your storyboard file.
|
||||
// Manual changes to this file will not be maintained.
|
||||
//
|
||||
using Foundation;
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Autofill
|
||||
{
|
||||
[Register ("LoginListViewController")]
|
||||
partial class LoginListViewController
|
||||
{
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIBarButtonItem AddBarButton { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIBarButtonItem CancelBarButton { get; set; }
|
||||
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UINavigationItem NavItem { get; set; }
|
||||
|
||||
[Action ("AddBarButton_Activated:")]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
partial void AddBarButton_Activated (UIKit.UIBarButtonItem sender);
|
||||
|
||||
[Action ("CancelBarButton_Activated:")]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
partial void CancelBarButton_Activated (UIKit.UIBarButtonItem sender);
|
||||
|
||||
void ReleaseDesignerOutlets ()
|
||||
{
|
||||
if (AddBarButton != null) {
|
||||
AddBarButton.Dispose ();
|
||||
AddBarButton = null;
|
||||
}
|
||||
|
||||
if (CancelBarButton != null) {
|
||||
CancelBarButton.Dispose ();
|
||||
CancelBarButton = null;
|
||||
}
|
||||
|
||||
if (NavItem != null) {
|
||||
NavItem.Dispose ();
|
||||
NavItem = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
31
src/iOS.Autofill/PasswordGeneratorViewController.cs
Normal file
31
src/iOS.Autofill/PasswordGeneratorViewController.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using UIKit;
|
||||
|
||||
namespace Bit.iOS.Extension
|
||||
{
|
||||
public partial class PasswordGeneratorViewController : Core.Controllers.PasswordGeneratorViewController
|
||||
{
|
||||
public PasswordGeneratorViewController(IntPtr handle) : base(handle)
|
||||
{ }
|
||||
|
||||
public LoginAddViewController Parent { get; set; }
|
||||
public override UINavigationItem BaseNavItem => NavItem;
|
||||
public override UIBarButtonItem BaseCancelButton => CancelBarButton;
|
||||
public override UIBarButtonItem BaseSelectBarButton => SelectBarButton;
|
||||
public override UILabel BasePasswordLabel => PasswordLabel;
|
||||
|
||||
partial void SelectBarButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
GoogleAnalyticsService.TrackExtensionEvent("SelectedGeneratedPassword");
|
||||
DismissViewController(true, () =>
|
||||
{
|
||||
Parent.PasswordCell.TextField.Text = PasswordLabel.Text;
|
||||
});
|
||||
}
|
||||
|
||||
partial void CancelBarButton_Activated(UIBarButtonItem sender)
|
||||
{
|
||||
DismissViewController(true, null);
|
||||
}
|
||||
}
|
||||
}
|
@ -203,11 +203,16 @@
|
||||
<AppExtensionDebugBundleId />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="LockFingerprintViewController.cs" />
|
||||
<Compile Include="LockPasswordViewController.cs" />
|
||||
<Compile Include="LockPinViewController.cs" />
|
||||
<Compile Include="LoginAddViewController.cs" />
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<Compile Include="Models\Context.cs" />
|
||||
<None Include="Info.plist" />
|
||||
<None Include="Entitlements.plist" />
|
||||
<Compile Include="PasswordGeneratorViewController.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<InterfaceDefinition Include="MainInterface.storyboard" />
|
||||
<Compile Include="CredentialProviderViewController.cs" />
|
||||
@ -215,9 +220,6 @@
|
||||
<DependentUpon>CredentialProviderViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LoginListViewController.cs" />
|
||||
<Compile Include="LoginListViewController.designer.cs">
|
||||
<DependentUpon>LoginListViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
Loading…
Reference in New Issue
Block a user