本文整理汇总了C++中COMPtr::createModalDialog方法的典型用法代码示例。如果您正苦于以下问题:C++ COMPtr::createModalDialog方法的具体用法?C++ COMPtr::createModalDialog怎么用?C++ COMPtr::createModalDialog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COMPtr
的用法示例。
在下文中一共展示了COMPtr::createModalDialog方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createWindow
Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features)
{
if (features.dialog) {
COMPtr<IWebUIDelegate> delegate = uiDelegate();
if (!delegate)
return 0;
COMPtr<IWebMutableURLRequest> request(AdoptCOM, WebMutableURLRequest::createInstance(frameLoadRequest.resourceRequest()));
COMPtr<IWebView> dialog;
if (FAILED(delegate->createModalDialog(m_webView, request.get(), &dialog)))
return 0;
return core(dialog.get());
}
Page* page = 0;
IWebUIDelegate* uiDelegate = 0;
IWebMutableURLRequest* request = WebMutableURLRequest::createInstance(frameLoadRequest.resourceRequest());
if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) {
IWebView* webView = 0;
if (SUCCEEDED(uiDelegate->createWebViewWithRequest(m_webView, request, &webView))) {
page = core(webView);
webView->Release();
}
uiDelegate->Release();
}
request->Release();
return page;
}
示例2: 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;
}
示例3: 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;
}