-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to WebView2 NuGet 1.0.1150.38
Renamed the "aWebView" parameter to "aFrame" in TWVBrowserBase.OnFrameNavigationStarting, TWVBrowserBase.OnFrameNavigationCompleted, TWVBrowserBase.OnFrameContentLoading, TWVBrowserBase.OnFrameDOMContentLoaded and TWVBrowserBase.OnFrameWebMessageReceived
- Loading branch information
1 parent
c48d2d9
commit 2b6fe85
Showing
36 changed files
with
1,552 additions
and
414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
object TBasicUserAuthForm: TTBasicUserAuthForm | ||
Left = 0 | ||
Top = 0 | ||
BorderIcons = [biSystemMenu] | ||
BorderStyle = bsSingle | ||
Caption = 'User authentication' | ||
ClientHeight = 195 | ||
ClientWidth = 537 | ||
Color = clBtnFace | ||
Font.Charset = DEFAULT_CHARSET | ||
Font.Color = clWindowText | ||
Font.Height = -12 | ||
Font.Name = 'Segoe UI' | ||
Font.Style = [] | ||
Position = poScreenCenter | ||
OnClose = FormClose | ||
OnDestroy = FormDestroy | ||
OnShow = FormShow | ||
PixelsPerInch = 96 | ||
DesignSize = ( | ||
537 | ||
195) | ||
TextHeight = 15 | ||
object InfoLbl: TLabel | ||
Left = 40 | ||
Top = 16 | ||
Width = 308 | ||
Height = 15 | ||
Caption = 'Type your username and password for the following page :' | ||
end | ||
object UsernameLbl: TLabel | ||
Left = 40 | ||
Top = 72 | ||
Width = 53 | ||
Height = 15 | ||
Caption = 'Username' | ||
end | ||
object PasswordLbl: TLabel | ||
Left = 40 | ||
Top = 120 | ||
Width = 50 | ||
Height = 15 | ||
Caption = 'Password' | ||
end | ||
object URILbl: TLabel | ||
Left = 40 | ||
Top = 37 | ||
Width = 3 | ||
Height = 15 | ||
end | ||
object ButtonPnl: TPanel | ||
Left = 0 | ||
Top = 160 | ||
Width = 537 | ||
Height = 35 | ||
Align = alBottom | ||
BevelOuter = bvNone | ||
Padding.Left = 40 | ||
Padding.Top = 5 | ||
Padding.Right = 40 | ||
Padding.Bottom = 5 | ||
TabOrder = 2 | ||
ExplicitWidth = 432 | ||
object OkBtn: TButton | ||
Left = 40 | ||
Top = 5 | ||
Width = 120 | ||
Height = 25 | ||
Align = alLeft | ||
Caption = 'Ok' | ||
Enabled = False | ||
ModalResult = 1 | ||
TabOrder = 0 | ||
OnClick = OkBtnClick | ||
ExplicitHeight = 31 | ||
end | ||
object CancelBtn: TButton | ||
Left = 377 | ||
Top = 5 | ||
Width = 120 | ||
Height = 25 | ||
Align = alRight | ||
Caption = 'Cancel' | ||
ModalResult = 2 | ||
TabOrder = 1 | ||
OnClick = CancelBtnClick | ||
ExplicitLeft = 317 | ||
ExplicitHeight = 31 | ||
end | ||
end | ||
object UsernameEdt: TEdit | ||
Left = 120 | ||
Top = 69 | ||
Width = 377 | ||
Height = 23 | ||
Anchors = [akLeft, akTop, akRight] | ||
TabOrder = 0 | ||
OnChange = UsernameEdtChange | ||
end | ||
object PasswordEdt: TEdit | ||
Left = 120 | ||
Top = 117 | ||
Width = 377 | ||
Height = 23 | ||
Anchors = [akLeft, akTop, akRight] | ||
PasswordChar = '*' | ||
TabOrder = 1 | ||
OnChange = UsernameEdtChange | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
unit uBasicUserAuthForm; | ||
|
||
interface | ||
|
||
uses | ||
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, | ||
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, | ||
uWVTypeLibrary, uWVCoreWebView2Args, uWVCoreWebView2Deferral; | ||
|
||
type | ||
TTBasicUserAuthForm = class(TForm) | ||
ButtonPnl: TPanel; | ||
OkBtn: TButton; | ||
CancelBtn: TButton; | ||
InfoLbl: TLabel; | ||
UsernameLbl: TLabel; | ||
PasswordLbl: TLabel; | ||
UsernameEdt: TEdit; | ||
PasswordEdt: TEdit; | ||
URILbl: TLabel; | ||
procedure FormClose(Sender: TObject; var Action: TCloseAction); | ||
procedure FormDestroy(Sender: TObject); | ||
procedure OkBtnClick(Sender: TObject); | ||
procedure CancelBtnClick(Sender: TObject); | ||
procedure UsernameEdtChange(Sender: TObject); | ||
procedure FormShow(Sender: TObject); | ||
private | ||
FArgs : TCoreWebView2BasicAuthenticationRequestedEventArgs; | ||
FDeferral : TCoreWebView2Deferral; | ||
FOkPressed : boolean; | ||
public | ||
constructor Create(AOwner: TComponent; const aArgs : ICoreWebView2BasicAuthenticationRequestedEventArgs); reintroduce; | ||
end; | ||
|
||
implementation | ||
|
||
{$R *.dfm} | ||
|
||
uses | ||
uWVCoreWebView2BasicAuthenticationResponse; | ||
|
||
procedure TTBasicUserAuthForm.CancelBtnClick(Sender: TObject); | ||
begin | ||
close; | ||
end; | ||
|
||
constructor TTBasicUserAuthForm.Create(AOwner: TComponent; const aArgs : ICoreWebView2BasicAuthenticationRequestedEventArgs); | ||
begin | ||
inherited Create(AOwner); | ||
|
||
FArgs := TCoreWebView2BasicAuthenticationRequestedEventArgs.Create(aArgs); | ||
FDeferral := TCoreWebView2Deferral.Create(FArgs.Deferral); | ||
FOkPressed := False; | ||
end; | ||
|
||
procedure TTBasicUserAuthForm.FormClose(Sender: TObject; var Action: TCloseAction); | ||
begin | ||
if not(FOkPressed) then | ||
FArgs.Cancel := True; | ||
|
||
Action := TCloseAction.caFree; | ||
end; | ||
|
||
procedure TTBasicUserAuthForm.FormDestroy(Sender: TObject); | ||
begin | ||
if assigned(FDeferral) then | ||
FreeAndNil(FDeferral); | ||
|
||
if assigned(FArgs) then | ||
FreeAndNil(FArgs); | ||
end; | ||
|
||
procedure TTBasicUserAuthForm.FormShow(Sender: TObject); | ||
begin | ||
URILbl.Caption := FArgs.URI; | ||
end; | ||
|
||
procedure TTBasicUserAuthForm.OkBtnClick(Sender: TObject); | ||
var | ||
TempResponse : TCoreWebView2BasicAuthenticationResponse; | ||
begin | ||
FOkPressed := True; | ||
|
||
TempResponse := TCoreWebView2BasicAuthenticationResponse.Create(FArgs.Response); | ||
TempResponse.Username := UsernameEdt.Text; | ||
TempResponse.Password := PasswordEdt.Text; | ||
TempResponse.Free; | ||
|
||
close; | ||
end; | ||
|
||
procedure TTBasicUserAuthForm.UsernameEdtChange(Sender: TObject); | ||
begin | ||
OkBtn.Enabled := (length(UsernameEdt.Text) > 0) and (length(PasswordEdt.Text) > 0); | ||
end; | ||
|
||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.