本文整理汇总了C#中Xilium.CefGlue.CefFrame类的典型用法代码示例。如果您正苦于以下问题:C# CefFrame类的具体用法?C# CefFrame怎么用?C# CefFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CefFrame类属于Xilium.CefGlue命名空间,在下文中一共展示了CefFrame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnLoadEnd
protected override void OnLoadEnd(CefBrowser browser, CefFrame frame, int httpStatusCode)
{
if (OnLoadEndEvent != null)
{
OnLoadEndEvent(browser, frame, httpStatusCode);
}
}
示例2: LoadErrorEventArgs
public LoadErrorEventArgs(CefFrame frame, CefErrorCode errorCode, string errorText, string failedUrl)
{
Frame = frame;
ErrorCode = errorCode;
ErrorText = errorText;
FailedUrl = failedUrl;
}
示例3: 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;
}
示例4: OnAddressChange
protected override void OnAddressChange( CefBrowser browser, CefFrame frame, string url )
{
if( frame.IsMain )
{
owner.OnAddressChanged( url );
}
}
示例5: GetContext
internal IWebView GetContext(CefFrame frame)
{
var taskCompletionSource = _TaskCompletionSources.GetOrDefault(frame.Identifier);
if (taskCompletionSource != null)
return taskCompletionSource.Task.Result;
return _Associated.GetOrDefault(frame.Identifier);
}
示例6: 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);
}
示例7: 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
}
示例8: EnsureLoaded
internal void EnsureLoaded(CefFrame frame)
{
var view = GetContext(frame);
if (view != null)
return;
var taskCompletionSource = new TaskCompletionSource<IWebView>();
_TaskCompletionSources.Add(frame.Identifier, taskCompletionSource);
//run dummy script to load context
frame.ExecuteJavaScript("(function(){})()", string.Empty, 0);
}
示例9: OnBeforeNavigation
protected override bool OnBeforeNavigation(CefBrowser browser, CefFrame frame, CefRequest request, CefNavigationType navigationType, bool isRedirect)
{
Console.WriteLine("OnBeforeNavigation: Request.Url={0} NavigationType={1} IsRedirect={2}",
request.Url,
navigationType,
isRedirect
);
return false;
}
示例10: OnQueryEventArgs
internal OnQueryEventArgs(CefBrowser _browser, CefFrame _frame, long _queryId, string _request, bool _persistent, CefMessageRouterBrowserSide.Callback _callback)
{
browser = _browser;
frame = _frame;
queryId = _queryId;
request = _request;
persistent = _persistent;
callback = _callback;
Handled = false; //default return value
}
示例11: Associate
internal void Associate(CefBrowser browser, CefFrame frame, CefV8Context context)
{
var webView = new CefV8_WebView(context,context.GetTaskRunner());
var taskCompletionSource = _TaskCompletionSources.GetOrDefault(frame.Identifier);
if (taskCompletionSource!=null)
{
_TaskCompletionSources.Remove(frame.Identifier);
taskCompletionSource.TrySetResult(webView);
}
_Associated.Add(frame.Identifier, webView);
}
示例12: OnBeforePopup
protected override bool OnBeforePopup( CefBrowser browser, CefFrame frame, string targetUrl, string targetFrameName, CefPopupFeatures popupFeatures, CefWindowInfo windowInfo, ref CefClient client, CefBrowserSettings settings, ref bool noJavascriptAccess )
{
var e = new BeforePopupEventArgs( frame, targetUrl, targetFrameName, popupFeatures, windowInfo, client, settings,
noJavascriptAccess );
this.owner.OnBeforePopup( e );
client = e.Client;
noJavascriptAccess = e.NoJavascriptAccess;
return e.Handled;
}
示例13: OnQuery
public override bool OnQuery(CefBrowser browser, CefFrame frame, long queryId, string request, bool persistent, CefMessageRouterBrowserSide.Callback callback)
{
Debug.WriteLine(DBGPREFIX + "OnQuery called, [" + queryId + " " + (persistent ? "" : "not" + " persistent]: ") + request);
var handler = OnQueryEvent;
if (handler != null)
{
Debug.WriteLine(DBGPREFIX + "OnQuery Delegate");
var e = new OnQueryEventArgs(browser, frame, queryId, request, persistent, callback);
handler(this, e);
return e.Handled;
}
return false;
}
示例14: BeforePopupEventArgs
public BeforePopupEventArgs(
CefFrame frame,
string targetUrl,
string targetFrameName,
CefPopupFeatures popupFeatures,
CefWindowInfo windowInfo,
CefClient client,
CefBrowserSettings settings,
bool noJavascriptAccess)
{
Frame = frame;
TargetUrl = targetUrl;
TargetFrameName = targetFrameName;
PopupFeatures = popupFeatures;
WindowInfo = windowInfo;
Client = client;
Settings = settings;
NoJavascriptAccess = noJavascriptAccess;
}
示例15: GetResourceHandler
protected override CefResourceHandler GetResourceHandler(CefBrowser browser, CefFrame frame, CefRequest request)
{
Debug.WriteLine(DBGPREFIX + "OnGetResourceHandler called for URL: " + request.Url);
var handler = OnGetResourceHandlerEvent;
if (handler != null)
{
LVCefRequest lvCefRequest = new LVCefRequest(OnProcessRequestEvent, OnCancelEvent);
Debug.WriteLine(DBGPREFIX + "OnGetResourceHandler for URL: " + request.Url + " assigned id " + lvCefRequest.id);
var e = new OnGetResourceHandlerEventArgs(lvCefRequest.id, browser, frame, request);
handler(this, e);
if (e.DelegateRequest)
{
Debug.WriteLine(DBGPREFIX + "OnGetResourceHandler for id " + lvCefRequest.id + " to be delegated");
return lvCefRequest;
}
}
Debug.WriteLine(DBGPREFIX + "OnGetResourceHandler for URL: " + request.Url + " to be handled normally by CEF");
return null;
}