Skip to content

Commit

Permalink
Add PutIsGeneralAutofillEnabled & PutIsPasswordAutosaveEnabled
Browse files Browse the repository at this point in the history
  • Loading branch information
leaanthony committed Sep 9, 2024
1 parent 75305f4 commit 11ef710
Show file tree
Hide file tree
Showing 109 changed files with 13,150 additions and 479 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.idea
pkg/edge_generated
pkg/edge_generated
/.aider.tags.cache.v3/
.aider*
6 changes: 4 additions & 2 deletions pkg/edge/ICoreWebView2Settings4.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ func (i *ICoreWebView2Settings4) GetIsPasswordAutosaveEnabled() (bool, error) {
return value, err
}

// PutIsPasswordAutosaveEnabled sets the IsPasswordAutosaveEnabled property.
// The default value is `FALSE`.
func (i *ICoreWebView2Settings4) PutIsPasswordAutosaveEnabled(value bool) error {

hr, _, err := i.Vtbl.PutIsPasswordAutosaveEnabled.Call(
uintptr(unsafe.Pointer(i)),
uintptr(unsafe.Pointer(&value)),
uintptr(boolToInt(value)),
)
if windows.Handle(hr) != windows.S_OK {
return syscall.Errno(hr)
Expand Down Expand Up @@ -107,7 +109,7 @@ func (i *ICoreWebView2Settings4) PutIsGeneralAutofillEnabled(value bool) error {

hr, _, err := i.Vtbl.PutIsGeneralAutofillEnabled.Call(
uintptr(unsafe.Pointer(i)),
uintptr(unsafe.Pointer(&value)),
uintptr(boolToInt(value)),
)
if windows.Handle(hr) != windows.S_OK {
return syscall.Errno(hr)
Expand Down
29 changes: 29 additions & 0 deletions pkg/edge/chromium.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,35 @@ func (e *Chromium) GetIsSwipeNavigationEnabled() (bool, error) {
return result, nil
}

// PutIsGeneralAutofillEnabled controls whether autofill for information
// like names, street and email addresses, phone numbers, and arbitrary input
// is enabled. This excludes password and credit card information. When
// IsGeneralAutofillEnabled is false, no suggestions appear, and no new information
// is saved. When IsGeneralAutofillEnabled is true, information is saved, suggestions
// appear and clicking on one will populate the form fields.
// It will take effect immediately after setting.
// The default value is `FALSE`.
func (e *Chromium) PutIsGeneralAutofillEnabled(value bool) error {
webview2Settings, err := e.webview.GetSettings()
if err != nil {
return err
}
webview2Settings4 := webview2Settings.GetICoreWebView2Settings4()
return webview2Settings4.PutIsGeneralAutofillEnabled(value)
}

// PutIsPasswordAutosaveEnabled sets whether the browser should offer to save passwords and other
// identifying information entered into forms automatically.
// The default value is `FALSE`.
func (e *Chromium) PutIsPasswordAutosaveEnabled(value bool) error {
webview2Settings, err := e.webview.GetSettings()
if err != nil {
return err
}
webview2Settings4 := webview2Settings.GetICoreWebView2Settings4()
return webview2Settings4.PutIsPasswordAutosaveEnabled(value)
}

func (e *Chromium) PutIsSwipeNavigationEnabled(enabled bool) error {
if !hasCapability(e.webview2RuntimeVersion, SwipeNavigation) {
return UnsupportedCapabilityError
Expand Down
727 changes: 677 additions & 50 deletions pkg/edge/version_map.go

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions pkg/webview2/COREWEBVIEW2_BROWSING_DATA_KINDS.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ package webview2
type COREWEBVIEW2_BROWSING_DATA_KINDS uint32

const (
COREWEBVIEW2_BROWSING_DATA_KINDS_FILE_SYSTEMS = 1 << 0
COREWEBVIEW2_BROWSING_DATA_KINDS_INDEXED_DB = 1 << 1
COREWEBVIEW2_BROWSING_DATA_KINDS_LOCAL_STORAGE = 1 << 2
COREWEBVIEW2_BROWSING_DATA_KINDS_WEB_SQL = 1 << 3
COREWEBVIEW2_BROWSING_DATA_KINDS_CACHE_STORAGE = 1 << 4
COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_DOM_STORAGE = 1 << 5
COREWEBVIEW2_BROWSING_DATA_KINDS_COOKIES = 1 << 6
COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_SITE = 1 << 7
COREWEBVIEW2_BROWSING_DATA_KINDS_DISK_CACHE = 1 << 8
COREWEBVIEW2_BROWSING_DATA_KINDS_DOWNLOAD_HISTORY = 1 << 9
COREWEBVIEW2_BROWSING_DATA_KINDS_GENERAL_AUTOFILL = 1 << 10
COREWEBVIEW2_BROWSING_DATA_KINDS_PASSWORD_AUTOSAVE = 1 << 11
COREWEBVIEW2_BROWSING_DATA_KINDS_BROWSING_HISTORY = 1 << 12
COREWEBVIEW2_BROWSING_DATA_KINDS_SETTINGS = 1 << 13
COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_PROFILE = 1 << 14
COREWEBVIEW2_BROWSING_DATA_KINDS_SERVICE_WORKERS = 1 << 15
COREWEBVIEW2_BROWSING_DATA_KINDS_FILE_SYSTEMS = 0x1
COREWEBVIEW2_BROWSING_DATA_KINDS_INDEXED_DB = 0x2
COREWEBVIEW2_BROWSING_DATA_KINDS_LOCAL_STORAGE = 0x4
COREWEBVIEW2_BROWSING_DATA_KINDS_WEB_SQL = 0x8
COREWEBVIEW2_BROWSING_DATA_KINDS_CACHE_STORAGE = 0x10
COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_DOM_STORAGE = 0x20
COREWEBVIEW2_BROWSING_DATA_KINDS_COOKIES = 0x40
COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_SITE = 0x80
COREWEBVIEW2_BROWSING_DATA_KINDS_DISK_CACHE = 0x100
COREWEBVIEW2_BROWSING_DATA_KINDS_DOWNLOAD_HISTORY = 0x200
COREWEBVIEW2_BROWSING_DATA_KINDS_GENERAL_AUTOFILL = 0x400
COREWEBVIEW2_BROWSING_DATA_KINDS_PASSWORD_AUTOSAVE = 0x800
COREWEBVIEW2_BROWSING_DATA_KINDS_BROWSING_HISTORY = 0x1000
COREWEBVIEW2_BROWSING_DATA_KINDS_SETTINGS = 0x2000
COREWEBVIEW2_BROWSING_DATA_KINDS_ALL_PROFILE = 0x4000
COREWEBVIEW2_BROWSING_DATA_KINDS_SERVICE_WORKERS = 0x8000
)
10 changes: 10 additions & 0 deletions pkg/webview2/COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build windows

package webview2

type COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND uint32

const (
COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND_FILE = 0
COREWEBVIEW2_FILE_SYSTEM_HANDLE_KIND_DIRECTORY = 1
)
10 changes: 10 additions & 0 deletions pkg/webview2/COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build windows

package webview2

type COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION uint32

const (
COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION_READ_ONLY = 0
COREWEBVIEW2_FILE_SYSTEM_HANDLE_PERMISSION_READ_WRITE = 1
)
36 changes: 18 additions & 18 deletions pkg/webview2/COREWEBVIEW2_MOUSE_EVENT_KIND.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ package webview2
type COREWEBVIEW2_MOUSE_EVENT_KIND uint32

const (
COREWEBVIEW2_MOUSE_EVENT_KIND_HORIZONTAL_WHEEL = 0x020E
COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_DOUBLE_CLICK = 0x0203
COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_DOWN = 0x0201
COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_UP = 0x0202
COREWEBVIEW2_MOUSE_EVENT_KIND_LEAVE = 0x02A3
COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_DOUBLE_CLICK = 0x0209
COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_DOWN = 0x0207
COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_UP = 0x0208
COREWEBVIEW2_MOUSE_EVENT_KIND_MOVE = 0x0200
COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_DOUBLE_CLICK = 0x0206
COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_DOWN = 0x0204
COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_UP = 0x0205
COREWEBVIEW2_MOUSE_EVENT_KIND_WHEEL = 0x020A
COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_DOUBLE_CLICK = 0x020D
COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_DOWN = 0x020B
COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_UP = 0x020C
COREWEBVIEW2_MOUSE_EVENT_KIND_NON_CLIENT_RIGHT_BUTTON_DOWN = 0x00A4
COREWEBVIEW2_MOUSE_EVENT_KIND_NON_CLIENT_RIGHT_BUTTON_UP = 0x00A5
COREWEBVIEW2_MOUSE_EVENT_KIND_HORIZONTAL_WHEEL = 526
COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_DOUBLE_CLICK = 515
COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_DOWN = 513
COREWEBVIEW2_MOUSE_EVENT_KIND_LEFT_BUTTON_UP = 514
COREWEBVIEW2_MOUSE_EVENT_KIND_LEAVE = 675
COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_DOUBLE_CLICK = 521
COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_DOWN = 519
COREWEBVIEW2_MOUSE_EVENT_KIND_MIDDLE_BUTTON_UP = 520
COREWEBVIEW2_MOUSE_EVENT_KIND_MOVE = 512
COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_DOUBLE_CLICK = 518
COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_DOWN = 516
COREWEBVIEW2_MOUSE_EVENT_KIND_RIGHT_BUTTON_UP = 517
COREWEBVIEW2_MOUSE_EVENT_KIND_WHEEL = 522
COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_DOUBLE_CLICK = 525
COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_DOWN = 523
COREWEBVIEW2_MOUSE_EVENT_KIND_X_BUTTON_UP = 524
COREWEBVIEW2_MOUSE_EVENT_KIND_NON_CLIENT_RIGHT_BUTTON_DOWN = 164
COREWEBVIEW2_MOUSE_EVENT_KIND_NON_CLIENT_RIGHT_BUTTON_UP = 165
)
14 changes: 7 additions & 7 deletions pkg/webview2/COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ type COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS uint32

const (
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_NONE = 0x0
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_LEFT_BUTTON = 0x0001
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_RIGHT_BUTTON = 0x0002
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_SHIFT = 0x0004
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_CONTROL = 0x0008
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_MIDDLE_BUTTON = 0x0010
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_X_BUTTON1 = 0x0020
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_X_BUTTON2 = 0x0040
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_LEFT_BUTTON = 0x1
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_RIGHT_BUTTON = 0x2
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_SHIFT = 0x4
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_CONTROL = 0x8
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_MIDDLE_BUTTON = 0x10
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_X_BUTTON1 = 0x20
COREWEBVIEW2_MOUSE_EVENT_VIRTUAL_KEYS_X_BUTTON2 = 0x40
)
24 changes: 12 additions & 12 deletions pkg/webview2/COREWEBVIEW2_PDF_TOOLBAR_ITEMS.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ type COREWEBVIEW2_PDF_TOOLBAR_ITEMS uint32

const (
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_NONE = 0x0
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SAVE = 0x0001
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PRINT = 0x0002
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SAVE_AS = 0x0004
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ZOOM_IN = 0x0008
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ZOOM_OUT = 0x0010
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ROTATE = 0x0020
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_FIT_PAGE = 0x0040
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PAGE_LAYOUT = 0x0080
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_BOOKMARKS = 0x0100
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PAGE_SELECTOR = 0x0200
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SEARCH = 0x0400
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_FULL_SCREEN = 0x0800
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SAVE = 0x1
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PRINT = 0x2
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SAVE_AS = 0x4
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ZOOM_IN = 0x8
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ZOOM_OUT = 0x10
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_ROTATE = 0x20
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_FIT_PAGE = 0x40
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PAGE_LAYOUT = 0x80
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_BOOKMARKS = 0x100
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PAGE_SELECTOR = 0x200
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SEARCH = 0x400
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_FULL_SCREEN = 0x800
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_MORE_SETTINGS = 0x1000
)
12 changes: 6 additions & 6 deletions pkg/webview2/COREWEBVIEW2_POINTER_EVENT_KIND.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ package webview2
type COREWEBVIEW2_POINTER_EVENT_KIND uint32

const (
COREWEBVIEW2_POINTER_EVENT_KIND_ACTIVATE = 0x024B
COREWEBVIEW2_POINTER_EVENT_KIND_DOWN = 0x0246
COREWEBVIEW2_POINTER_EVENT_KIND_ENTER = 0x0249
COREWEBVIEW2_POINTER_EVENT_KIND_LEAVE = 0x024A
COREWEBVIEW2_POINTER_EVENT_KIND_UP = 0x0247
COREWEBVIEW2_POINTER_EVENT_KIND_UPDATE = 0x0245
COREWEBVIEW2_POINTER_EVENT_KIND_ACTIVATE = 587
COREWEBVIEW2_POINTER_EVENT_KIND_DOWN = 582
COREWEBVIEW2_POINTER_EVENT_KIND_ENTER = 585
COREWEBVIEW2_POINTER_EVENT_KIND_LEAVE = 586
COREWEBVIEW2_POINTER_EVENT_KIND_UP = 583
COREWEBVIEW2_POINTER_EVENT_KIND_UPDATE = 581
)
12 changes: 12 additions & 0 deletions pkg/webview2/COREWEBVIEW2_SAVE_AS_KIND.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//go:build windows

package webview2

type COREWEBVIEW2_SAVE_AS_KIND uint32

const (
COREWEBVIEW2_SAVE_AS_KIND_DEFAULT = 0
COREWEBVIEW2_SAVE_AS_KIND_HTML_ONLY = 1
COREWEBVIEW2_SAVE_AS_KIND_SINGLE_FILE = 2
COREWEBVIEW2_SAVE_AS_KIND_COMPLETE = 3
)
13 changes: 13 additions & 0 deletions pkg/webview2/COREWEBVIEW2_SAVE_AS_UI_RESULT.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//go:build windows

package webview2

type COREWEBVIEW2_SAVE_AS_UI_RESULT uint32

const (
COREWEBVIEW2_SAVE_AS_UI_RESULT_SUCCESS = 0
COREWEBVIEW2_SAVE_AS_UI_RESULT_INVALID_PATH = 1
COREWEBVIEW2_SAVE_AS_UI_RESULT_FILE_ALREADY_EXISTS = 2
COREWEBVIEW2_SAVE_AS_UI_RESULT_KIND_NOT_SUPPORTED = 3
COREWEBVIEW2_SAVE_AS_UI_RESULT_CANCELLED = 4
)
11 changes: 11 additions & 0 deletions pkg/webview2/COREWEBVIEW2_TEXT_DIRECTION_KIND.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//go:build windows

package webview2

type COREWEBVIEW2_TEXT_DIRECTION_KIND uint32

const (
COREWEBVIEW2_TEXT_DIRECTION_KIND_DEFAULT = 0
COREWEBVIEW2_TEXT_DIRECTION_KIND_LEFT_TO_RIGHT = 1
COREWEBVIEW2_TEXT_DIRECTION_KIND_RIGHT_TO_LEFT = 2
)
11 changes: 5 additions & 6 deletions pkg/webview2/COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ package webview2
type COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS uint32

const (
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_NONE = 0
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_DOCUMENT = 1
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_SHARED_WORKER = 2
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_SERVICE_WORKER = 4
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_ALL = 0
XFFFFFFFF = 5
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_NONE = 0x0
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_DOCUMENT = 0x1
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_SHARED_WORKER = 0x2
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_SERVICE_WORKER = 0x4
COREWEBVIEW2_WEB_RESOURCE_REQUEST_SOURCE_KINDS_ALL = 0xFFFFFFFF
)
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ func ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandlerIUnknownRel
return this.impl.Release()
}

func ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandlerInvoke(this *ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler, errorCode uintptr, id string) uintptr {
return this.impl.AddScriptToExecuteOnDocumentCreatedCompleted(errorCode, id)
func ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandlerInvoke(this *ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandler, errorCode uintptr, result string) uintptr {
return this.impl.AddScriptToExecuteOnDocumentCreatedCompleted(errorCode, result)
}

type ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandlerImpl interface {
IUnknownImpl
AddScriptToExecuteOnDocumentCreatedCompleted(errorCode uintptr, id string) uintptr
AddScriptToExecuteOnDocumentCreatedCompleted(errorCode uintptr, result string) uintptr
}

var ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandlerFn = ICoreWebView2AddScriptToExecuteOnDocumentCreatedCompletedHandlerVtbl{
Expand Down
16 changes: 8 additions & 8 deletions pkg/webview2/ICoreWebView2BrowserExtensionList.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,31 @@ func (i *ICoreWebView2BrowserExtensionList) AddRef() uintptr {
return refCounter
}

func (i *ICoreWebView2BrowserExtensionList) GetCount() (uint, error) {
func (i *ICoreWebView2BrowserExtensionList) GetCount() (uint32, error) {

var count uint
var value uint32

hr, _, err := i.Vtbl.GetCount.Call(
uintptr(unsafe.Pointer(i)),
uintptr(unsafe.Pointer(&count)),
uintptr(unsafe.Pointer(&value)),
)
if windows.Handle(hr) != windows.S_OK {
return 0, syscall.Errno(hr)
}
return count, err
return value, err
}

func (i *ICoreWebView2BrowserExtensionList) GetValueAtIndex(index uint) (*ICoreWebView2BrowserExtension, error) {
func (i *ICoreWebView2BrowserExtensionList) GetValueAtIndex(index uint32) (*ICoreWebView2BrowserExtension, error) {

var extension *ICoreWebView2BrowserExtension
var value *ICoreWebView2BrowserExtension

hr, _, err := i.Vtbl.GetValueAtIndex.Call(
uintptr(unsafe.Pointer(i)),
uintptr(unsafe.Pointer(&index)),
uintptr(unsafe.Pointer(&extension)),
uintptr(unsafe.Pointer(&value)),
)
if windows.Handle(hr) != windows.S_OK {
return nil, syscall.Errno(hr)
}
return extension, err
return value, err
}
6 changes: 3 additions & 3 deletions pkg/webview2/ICoreWebView2BrowserProcessExitedEventArgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ func (i *ICoreWebView2BrowserProcessExitedEventArgs) AddRef() uintptr {

func (i *ICoreWebView2BrowserProcessExitedEventArgs) GetBrowserProcessExitKind() (COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND, error) {

var browserProcessExitKind COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND
var value COREWEBVIEW2_BROWSER_PROCESS_EXIT_KIND

hr, _, err := i.Vtbl.GetBrowserProcessExitKind.Call(
uintptr(unsafe.Pointer(i)),
uintptr(unsafe.Pointer(&browserProcessExitKind)),
uintptr(unsafe.Pointer(&value)),
)
if windows.Handle(hr) != windows.S_OK {
return 0, syscall.Errno(hr)
}
return browserProcessExitKind, err
return value, err
}

func (i *ICoreWebView2BrowserProcessExitedEventArgs) GetBrowserProcessId() (uint32, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ func ICoreWebView2CallDevToolsProtocolMethodCompletedHandlerIUnknownRelease(this
return this.impl.Release()
}

func ICoreWebView2CallDevToolsProtocolMethodCompletedHandlerInvoke(this *ICoreWebView2CallDevToolsProtocolMethodCompletedHandler, errorCode uintptr, returnObjectAsJson string) uintptr {
return this.impl.CallDevToolsProtocolMethodCompleted(errorCode, returnObjectAsJson)
func ICoreWebView2CallDevToolsProtocolMethodCompletedHandlerInvoke(this *ICoreWebView2CallDevToolsProtocolMethodCompletedHandler, errorCode uintptr, result string) uintptr {
return this.impl.CallDevToolsProtocolMethodCompleted(errorCode, result)
}

type ICoreWebView2CallDevToolsProtocolMethodCompletedHandlerImpl interface {
IUnknownImpl
CallDevToolsProtocolMethodCompleted(errorCode uintptr, returnObjectAsJson string) uintptr
CallDevToolsProtocolMethodCompleted(errorCode uintptr, result string) uintptr
}

var ICoreWebView2CallDevToolsProtocolMethodCompletedHandlerFn = ICoreWebView2CallDevToolsProtocolMethodCompletedHandlerVtbl{
Expand Down
Loading

0 comments on commit 11ef710

Please sign in to comment.