提交 0931d93c 编写于 作者: yanghye's avatar yanghye

U: viewsource

上级 c2c7e75a
......@@ -46,6 +46,20 @@ func (m *ICefBrowser) createBrowserViewSource() {
request.SetHeaderByName(assetserve.AssetsServerHeaderKeyName, assetserve.AssetsServerHeaderKeyValue, true)
})
}
viewSourceWindow.Chromium().SetOnBeforePopup(func(sender lcl.IObject, browser *ICefBrowser, frame *ICefFrame, beforePopupInfo *BeforePopupInfo, client *ICefClient, noJavascriptAccess *bool) bool {
wp := NewWindowProperty()
wp.Url = beforePopupInfo.TargetUrl
wp.Title = beforePopupInfo.TargetUrl
wp.WindowType = WT_VIEW_SOURCE
bw := NewLCLBrowserWindow(nil, wp)
bw.SetWidth(800)
bw.SetHeight(600)
bw.EnableDefaultCloseEvent()
QueueAsyncCall(func(id int) { //main thread run
bw.Show()
})
return true
})
viewSourceWindow.EnableDefaultCloseEvent()
QueueAsyncCall(func(id int) { //main thread run
viewSourceWindow.Show()
......
......@@ -148,9 +148,9 @@ func (m *ICefDragData) GetFileContents(writer *ICefStreamWriter) uint32 {
return uint32(r1)
}
func (m *ICefDragData) GetFileNames() ([]string, int32) {
func (m *ICefDragData) GetFileNames() []string {
if !m.IsValid() {
return nil, 0
return nil
}
var result uintptr
r1, _, _ := imports.Proc(def.CefDragData_GetFileNames).Call(m.Instance(), uintptr(unsafe.Pointer(&result)))
......@@ -163,10 +163,10 @@ func (m *ICefDragData) GetFileNames() ([]string, int32) {
fileNames[i] = fileNamesList.Strings(int32(i))
}
fileNamesList.Free()
return fileNames, int32(count)
return fileNames
}
}
return nil, 0
return nil
}
func (m *ICefDragData) SetLinkUrl(url string) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册