本文整理汇总了C#中CefBrowser类的典型用法代码示例。如果您正苦于以下问题:C# CefBrowser类的具体用法?C# CefBrowser怎么用?C# CefBrowser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CefBrowser类属于命名空间,在下文中一共展示了CefBrowser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnAddressChange
protected override void OnAddressChange(CefBrowser browser, CefFrame frame, string url)
{
if (frame.IsMain)
{
_core.OnAddressChanged(url);
}
}
示例2: OnBeforeClose
protected override void OnBeforeClose(CefBrowser browser)
{
if (_core.InvokeRequired)
_core.BeginInvoke((Action)_core.OnBeforeClose);
else
_core.OnBeforeClose();
}
示例3: OnJSPrompt
protected override bool OnJSPrompt(CefBrowser browser, CefFrame frame, string message, string defaultValue, out bool retval, out string result)
{
// TODO: CefWebJSDialogHandler.OnJSPrompt
retval = false;
result = null;
return false;
}
示例4: OnAddressChange
protected override void OnAddressChange(CefBrowser browser, CefFrame frame, string url)
{
if (frame.IsMain)
{
_core.InvokeIfRequired(() => _core.OnAddressChanged(new AddressChangedEventArgs(frame, url)));
}
}
示例5: OnNavStateChange
protected override void OnNavStateChange(CefBrowser browser, bool canGoBack, bool canGoForward)
{
#if DIAGNOSTICS
Cef.Logger.Trace(LogTarget.CefDisplayHandler, "OnNavStateChange: CanGoBack=[{0}] CanGoForward=[{1}]", canGoBack, canGoForward);
#endif
this.context.OnNavStateChanged(canGoBack, canGoForward);
}
示例6: ConsoleMessageEventArgs
public ConsoleMessageEventArgs(CefBrowser browser, string message, string source, int line)
{
this.CefBrowser = browser;
this.Message = message;
this.Source = source;
this.Line = line;
}
示例7: OnConsoleMessage
protected override bool OnConsoleMessage(CefBrowser browser, string message, string source, int line)
{
var e = new ConsoleMessageEventArgs(message, source, line);
_core.InvokeIfRequired(() => _core.OnConsoleMessage(e));
return e.Handled;
}
示例8: OnAfterCreated
protected override void OnAfterCreated(CefBrowser browser)
{
#if DIAGNOSTICS
Cef.Logger.Trace(LogTarget.CefLifeSpanHandler, "OnAfterCreated");
#endif
this.context.OnAfterCreated(browser);
// TODO: check context state, it can be already closed
this.context.Attach(browser);
/*
if (!browser.IsPopup)
{
if (this.context.IsDisposed)
{
browser.Close();
return;
}
this.context.browser = browser;
this.context.browserWindowHandle = browser.WindowHandle;
this.context.SetStyle(ControlStyles.Opaque, true);
this.context.ResizeBrowserWindow();
// FIXME: this is invalid - can't be accessed from another thread
//if (this.control.Focused)
//{
// this.control.browser.SetFocus(true);
//}
}
*/
}
示例9: OnContextReleased
protected unsafe override void OnContextReleased(CefBrowser browser, CefFrame frame, CefV8Context context)
{
if (_context.MainFrame != null)
{
_context.MainFrame.UnbindV8Context();
}
}
示例10: OnBeforeBrowse
protected override bool OnBeforeBrowse(CefBrowser browser, CefFrame frame, CefRequest request, CefHandlerNavType navType, bool isRedirect)
{
#if DIAGNOSTICS
Cef.Logger.Trace(LogTarget.CefRequestHandler, "OnBeforeBrowse: Method=[{0}] Url=[{1}] NavType=[{2}] IsRedirect=[{3}]", request.GetMethod(), request.GetURL(), navType, isRedirect);
#endif
var cancel = this.context.OnNavigating(frame, request, navType, isRedirect);
if (cancel) return true;
if (frame.IsMain)
{
// browser navigating to a new page
this.context.ClearFrames();
this.context.AttachMainFrame(frame);
this.context.ClearReadyState();
this.context.SetFrameReadyState(null, FrameReadyState.Navigating);
}
else if ((this.context.ReadyOptions & CefReadyOptions.Frames) != 0)
{
this.context.SetFrameReadyState(frame.GetName(), FrameReadyState.Navigating);
}
return false;
}
示例11: OnTitleChange
protected override void OnTitleChange(CefBrowser browser, string title)
{
#if DIAGNOSTICS
Cef.Logger.Trace(LogTarget.CefDisplayHandler, "OnTitleChange: Title=[{0}]", title);
#endif
this.context.OnTitleChanged(title);
}
示例12: OnCursorChange
protected override void OnCursorChange(CefBrowser browser, IntPtr cursorHandle)
{
_uiHelper.PerformInUiThread(() =>
{
Cursor cursor = CursorInteropHelper.Create(new SafeFileHandle(cursorHandle, false));
_owner.Cursor = cursor;
});
}
示例13: CefUncaughtExceptionEventArgs
public CefUncaughtExceptionEventArgs(CefBrowser browser, CefFrame frame, CefV8Context context, CefV8Exception exception, CefV8StackTrace stackTrace)
{
this.browser = browser;
this.frame = frame;
this.context = context;
this.exception = exception;
this.stackTrace = stackTrace;
}
示例14: DoClose
protected override bool DoClose(CefBrowser browser)
{
#if DIAGNOSTICS
Cef.Logger.Trace(LogTarget.CefLifeSpanHandler, "DoClose");
#endif
return false;
}
示例15: CefBeforePopupEventArgs
public CefBeforePopupEventArgs(CefBrowser parentBrowser, CefPopupFeatures popupFeatures, CefWindowInfo windowInfo, string url, ref CefClient client, CefBrowserSettings settings)
{
this.parentBrowser = parentBrowser;
this.popupFeatures = popupFeatures;
this.windowInfo = windowInfo;
this.url = url;
this.client = client;
this.settings = settings;
}