本文整理汇总了C++中COMPtr::createWebViewWithRequest方法的典型用法代码示例。如果您正苦于以下问题:C++ COMPtr::createWebViewWithRequest方法的具体用法?C++ COMPtr::createWebViewWithRequest怎么用?C++ COMPtr::createWebViewWithRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COMPtr
的用法示例。
在下文中一共展示了COMPtr::createWebViewWithRequest方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createWindow
Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features, const NavigationAction&)
{
COMPtr<IWebUIDelegate> delegate = uiDelegate();
if (!delegate)
return 0;
COMPtr<IWebMutableURLRequest> request(AdoptCOM, WebMutableURLRequest::createInstance(frameLoadRequest.resourceRequest()));
COMPtr<IWebUIDelegatePrivate2> delegatePrivate(Query, delegate);
if (delegatePrivate) {
COMPtr<IWebView> newWebView;
HRESULT hr = delegatePrivate->createWebViewWithRequest(m_webView, request.get(), createWindowFeaturesPropertyBag(features).get(), &newWebView);
if (SUCCEEDED(hr) && newWebView)
return core(newWebView.get());
// If the delegate doesn't implement the IWebUIDelegatePrivate2 version of the call, fall back
// to the old versions (even if they support the IWebUIDelegatePrivate2 interface).
if (hr != E_NOTIMPL)
return 0;
}
COMPtr<IWebView> newWebView;
if (features.dialog) {
if (FAILED(delegate->createModalDialog(m_webView, request.get(), &newWebView)))
return 0;
} else if (FAILED(delegate->createWebViewWithRequest(m_webView, request.get(), &newWebView)))
return 0;
return newWebView ? core(newWebView.get()) : 0;
}
示例2: dispatchCreatePage
Frame* WebFrameLoaderClient::dispatchCreatePage()
{
WebView* webView = m_webFrame->webView();
COMPtr<IWebUIDelegate> ui;
if (FAILED(webView->uiDelegate(&ui)))
return 0;
COMPtr<IWebView> newWebView;
if (FAILED(ui->createWebViewWithRequest(webView, 0, &newWebView)))
return 0;
COMPtr<IWebFrame> mainFrame;
if (FAILED(newWebView->mainFrame(&mainFrame)))
return 0;
COMPtr<WebFrame> mainFrameImpl(Query, mainFrame);
return core(mainFrameImpl.get());
}
示例3: dispatchCreatePage
Frame* WebFrameLoaderClient::dispatchCreatePage(const NavigationAction& navigationAction)
{
WebView* webView = m_webFrame->webView();
COMPtr<IWebUIDelegate> ui;
if (FAILED(webView->uiDelegate(&ui)))
return 0;
COMPtr<IWebView> newWebView;
COMPtr<WebMutableURLRequest> request = adoptCOM(WebMutableURLRequest::createInstance(ResourceRequest(navigationAction.url())));
if (FAILED(ui->createWebViewWithRequest(webView, request.get(), &newWebView)) || !newWebView)
return 0;
COMPtr<IWebFrame> mainFrame;
if (FAILED(newWebView->mainFrame(&mainFrame)))
return 0;
COMPtr<WebFrame> mainFrameImpl(Query, mainFrame);
return core(mainFrameImpl.get());
}
示例4: createWindow
Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest&, const WindowFeatures& features, const NavigationAction& navigationAction)
{
COMPtr<IWebUIDelegate> delegate = uiDelegate();
if (!delegate)
return 0;
#if ENABLE(FULLSCREEN_API)
if (frame->document() && frame->document()->webkitCurrentFullScreenElement())
frame->document()->webkitCancelFullScreen();
#endif
COMPtr<WebMutableURLRequest> request = adoptCOM(WebMutableURLRequest::createInstance(ResourceRequest(navigationAction.url())));
COMPtr<IWebUIDelegatePrivate2> delegatePrivate(Query, delegate);
if (delegatePrivate) {
COMPtr<IWebView> newWebView;
HRESULT hr = delegatePrivate->createWebViewWithRequest(m_webView, request.get(), createWindowFeaturesPropertyBag(features).get(), &newWebView);
if (SUCCEEDED(hr) && newWebView)
return core(newWebView.get());
// If the delegate doesn't implement the IWebUIDelegatePrivate2 version of the call, fall back
// to the old versions (even if they support the IWebUIDelegatePrivate2 interface).
if (hr != E_NOTIMPL)
return 0;
}
COMPtr<IWebView> newWebView;
if (features.dialog) {
if (FAILED(delegate->createModalDialog(m_webView, request.get(), &newWebView)))
return 0;
} else if (FAILED(delegate->createWebViewWithRequest(m_webView, request.get(), &newWebView)))
return 0;
return newWebView ? core(newWebView.get()) : 0;
}