本文整理汇总了C#中Xilium.CefGlue.CefBrowser类的典型用法代码示例。如果您正苦于以下问题:C# CefBrowser类的具体用法?C# CefBrowser怎么用?C# CefBrowser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CefBrowser类属于Xilium.CefGlue命名空间,在下文中一共展示了CefBrowser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnLoadEnd
protected override void OnLoadEnd(CefBrowser browser, CefFrame frame, int httpStatusCode)
{
if (OnLoadEndEvent != null)
{
OnLoadEndEvent(browser, frame, httpStatusCode);
}
}
示例2: OnAddressChange
protected override void OnAddressChange( CefBrowser browser, CefFrame frame, string url )
{
if( frame.IsMain )
{
owner.OnAddressChanged( url );
}
}
示例3: ConsoleMessageEventArgs
public ConsoleMessageEventArgs(CefBrowser browser, string message, string source, int line)
{
this.CefBrowser = browser;
this.Message = message;
this.Source = source;
this.Line = line;
}
示例4: OnProcessMessageReceived
protected override bool OnProcessMessageReceived(CefBrowser browser, CefProcessId sourceProcess, CefProcessMessage message)
{
if (!this.loggingService.IsDebugEnabled)
{
return false;
}
this.loggingService.Debug("Client::OnProcessMessageReceived: SourceProcess={0}", sourceProcess);
this.loggingService.Debug("Message Name={0} IsValid={1} IsReadOnly={2}", message.Name, message.IsValid, message.IsReadOnly);
var arguments = message.Arguments;
for (var i = 0; i < arguments.Count; i++)
{
var type = arguments.GetValueType(i);
object value;
switch (type)
{
case CefValueType.Null: value = null; break;
case CefValueType.String: value = arguments.GetString(i); break;
case CefValueType.Int: value = arguments.GetInt(i); break;
case CefValueType.Double: value = arguments.GetDouble(i); break;
case CefValueType.Bool: value = arguments.GetBool(i); break;
default: value = null; break;
}
this.loggingService.Debug(" [{0}] ({1}) = {2}", i, type, value);
}
return false;
}
示例5: OnBeforeClose
protected override void OnBeforeClose(CefBrowser browser)
{
if (_core.InvokeRequireOnUi())
_core.MainUiDispatcher.BeginInvoke((Action)_core.OnBeforeClose);
else
_core.OnBeforeClose();
}
示例6: DoClose
protected override bool DoClose(CefBrowser browser)
{
Debug.WriteLine(DBGPREFIX + "DoClose");
// Returning false will send a top level browser close event? guess that is why the labview window closed?
// Sure does, need to return true and figure out more about the workflow
return true;
}
示例7: OnProcessMessageReceived
protected override bool OnProcessMessageReceived(CefBrowser browser, CefProcessId sourceProcess, CefProcessMessage message)
{
Console.WriteLine("Render::OnProcessMessageReceived: SourceProcess={0}", sourceProcess);
Console.WriteLine("Message Name={0} IsValid={1} IsReadOnly={2}", message.Name, message.IsValid, message.IsReadOnly);
var arguments = message.Arguments;
for (var i = 0; i < arguments.Count; i++)
{
var type = arguments.GetValueType(i);
object value;
switch (type)
{
case CefValueType.Null: value = null; break;
case CefValueType.String: value = arguments.GetString(i); break;
case CefValueType.Int: value = arguments.GetInt(i); break;
case CefValueType.Double: value = arguments.GetDouble(i); break;
case CefValueType.Bool: value = arguments.GetBool(i); break;
default: value = null; break;
}
Console.WriteLine(" [{0}] ({1}) = {2}", i, type, value);
}
if (message.Name == "myMessage2") return true;
var message2 = CefProcessMessage.Create("myMessage2");
var success = browser.SendProcessMessage(CefProcessId.Renderer, message2);
Console.WriteLine("Sending myMessage2 to renderer process = {0}", success);
var message3 = CefProcessMessage.Create("myMessage3");
var success2 = browser.SendProcessMessage(CefProcessId.Browser, message3);
Console.WriteLine("Sending myMessage3 to browser process = {0}", success);
return false;
}
示例8: InitTask
private Task<IWebBrowserWindowProvider> InitTask(string fullpath, IWebSessionLogger logger)
{
TaskCompletionSource<IWebBrowserWindowProvider> tcs = new TaskCompletionSource<IWebBrowserWindowProvider>();
Task.Run(async () =>
{
var cefWindowInfo = CefWindowInfo.Create();
cefWindowInfo.SetAsWindowless(IntPtr.Zero, true);
//// Settings for the browser window itself (e.g. enable JavaScript?).
var cefBrowserSettings = new CefBrowserSettings();
// Initialize some the cust interactions with the browser process.
var cefClient = new TestCefClient();
// Start up the browser instance.
CefBrowserHost.CreateBrowser(cefWindowInfo, cefClient, cefBrowserSettings, fullpath);
_CefBrowser = await cefClient.GetLoadedBrowserAsync();
_CefFrame = _CefBrowser.GetMainFrame();
_TestCefGlueHTMLWindowProvider = new TestCefGlueHTMLWindowProvider(_CefFrame, cefClient);
tcs.SetResult(_TestCefGlueHTMLWindowProvider);
});
return tcs.Task;
}
示例9: OnProcessMessageReceived
protected override bool OnProcessMessageReceived(CefBrowser browser, CefProcessId sourceProcess, CefProcessMessage message)
{
if (DumpProcessMessages)
{
Console.WriteLine("Client::OnProcessMessageReceived: SourceProcess={0}", sourceProcess);
Console.WriteLine("Message Name={0} IsValid={1} IsReadOnly={2}", message.Name, message.IsValid, message.IsReadOnly);
var arguments = message.Arguments;
for (var i = 0; i < arguments.Count; i++)
{
var type = arguments.GetValueType(i);
object value;
switch (type)
{
case CefValueType.Null: value = null; break;
case CefValueType.String: value = arguments.GetString(i); break;
case CefValueType.Int: value = arguments.GetInt(i); break;
case CefValueType.Double: value = arguments.GetDouble(i); break;
case CefValueType.Bool: value = arguments.GetBool(i); break;
default: value = null; break;
}
Console.WriteLine(" [{0}] ({1}) = {2}", i, type, value);
}
}
var handled = DemoApp.BrowserMessageRouter.OnProcessMessageReceived(browser, sourceProcess, message);
if (handled) return true;
if (message.Name == "myMessage2" || message.Name == "myMessage3") return true;
return false;
}
示例10: OnLoadStart
protected override void OnLoadStart(CefBrowser browser, CefFrame frame)
{
base.OnLoadStart(browser, frame);
var message = CefProcessMessage.Create("SetOverlayAPI");
message.Arguments.SetString(0, frame.Name);
browser.SendProcessMessage(CefProcessId.Renderer, message);
}
示例11: OnGetResourceHandlerEventArgs
public OnGetResourceHandlerEventArgs(string _id, CefBrowser _browser, CefFrame _frame, CefRequest _request)
{
id = _id;
browser = _browser;
frame = _frame;
request = _request;
DelegateRequest = false; //Default do not delegate, allow CEF to handle using network
}
示例12: OnCursorChange
protected override void OnCursorChange( CefBrowser browser, IntPtr cursorHandle )
{
//_uiHelper.PerformInUiThread(() =>
//{
// Cursor cursor = CursorInteropHelper.Create(new SafeFileHandle(cursorHandle, false));
// _owner.Cursor = cursor;
//});
}
示例13: GetRootScreenRect
protected override bool GetRootScreenRect(CefBrowser browser, ref CefRectangle rect)
{
rect.X = 0;
rect.Y = 0;
rect.Width = this.screenWidth;
rect.Height = this.screenHeight;
return true;
}
示例14: GetScreenInfo
protected override bool GetScreenInfo(CefBrowser browser, CefScreenInfo screenInfo)
{
var rect = screenInfo.Rectangle;
this.GetRootScreenRect(browser, ref rect);
screenInfo.Depth = 32;
screenInfo.IsMonochrome = false;
return true;
}
示例15: OnStatusMessage
protected override void OnStatusMessage(CefBrowser browser, string value)
{
if (browser == null)
{
API.Instance.Log("Browser null: invalid OnStatusMessage.");
return;
}
API.Instance.Log("Browser {0}: Status message: {1}", browser.Identifier, value);
}