本文整理汇总了C++中CefWindowInfo类的典型用法代码示例。如果您正苦于以下问题:C++ CefWindowInfo类的具体用法?C++ CefWindowInfo怎么用?C++ CefWindowInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CefWindowInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialise
void CWebView::Initialise ()
{
// Initialise the web session (which holds the actual settings) in in-memory mode
CefBrowserSettings browserSettings;
browserSettings.windowless_frame_rate = g_pCore->GetFrameRateLimit ();
browserSettings.javascript_access_clipboard = cef_state_t::STATE_DISABLED;
browserSettings.java = cef_state_t::STATE_DISABLED;
browserSettings.caret_browsing = cef_state_t::STATE_ENABLED;
browserSettings.universal_access_from_file_urls = cef_state_t::STATE_DISABLED; // Also filtered by resource interceptor, but set this nevertheless
browserSettings.file_access_from_file_urls = cef_state_t::STATE_DISABLED;
browserSettings.webgl = cef_state_t::STATE_ENABLED;
browserSettings.javascript_open_windows = cef_state_t::STATE_DISABLED;
bool bEnabledPlugins = g_pCore->GetWebCore ()->GetPluginsEnabled ();
browserSettings.plugins = bEnabledPlugins ? cef_state_t::STATE_ENABLED : cef_state_t::STATE_DISABLED;
if ( !m_bIsLocal )
{
bool bEnabledJavascript = g_pCore->GetWebCore ()->GetRemoteJavascriptEnabled ();
browserSettings.javascript = bEnabledJavascript ? cef_state_t::STATE_ENABLED : cef_state_t::STATE_DISABLED;
}
CefWindowInfo windowInfo;
windowInfo.SetAsWindowless ( g_pCore->GetHookedWindow (), m_bIsTransparent );
CefBrowserHost::CreateBrowser ( windowInfo, this, "", browserSettings, nullptr );
}
示例2: AddWebView
void AddWebView(CefWindowHandle parent, RECT windowRect, char* url, Settings* settings) {
CefWindowInfo windowInfo;
windowInfo.SetAsChild(parent, windowRect);
windowInfo.SetTransparentPainting(true);
g_handler->browserSettings_.web_security_disabled = settings->getBoolean("disableSecurity", false);
CefBrowser::CreateBrowser(windowInfo, static_cast<CefRefPtr<CefClient>>(g_handler), url, g_handler->browserSettings_);
}
示例3: CreateBrowser
bool QCefWebView::CreateBrowser(const QSize& size) {
//qDebug() << __FUNCTION__ << __LINE__;
if (browser_state_ != kNone || size.isEmpty()) {
return false;
}
mutex_.lock();
if (browser_state_ != kNone) {
mutex_.unlock();
return false;
}
//qDebug() << __FUNCTION__ << __LINE__;
RECT rect;
rect.left = 0;
rect.top = 0;
rect.right = size.width();
rect.bottom = size.height();
CefWindowInfo info;
CefBrowserSettings settings;
info.SetAsChild((HWND) this->winId(), rect);
qcef_client_handler->set_listener(this);
QString url = url_.isEmpty() ? kUrlBlank : url_.toString();
CefBrowserHost::CreateBrowser(info,
qcef_client_handler.get(),
CefString(url.toStdWString()),
settings,
NULL);
browser_state_ = kCreating;
mutex_.unlock();
return true;
}
示例4: client
int CefJamCEFHtmlView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
CRect rcClient;
this->GetClientRect(&rcClient);
// TODO: Add your specialized creation code here
CefRefPtr<CefJamClientHandler> client(new CefJamClientHandler());
m_pClientHandler = client;
CefWindowInfo info;
info.SetAsChild( m_hWnd, rcClient);
CefBrowserSettings browserSettings;
//static_cast<CefRefPtr<CefClient> >(client)
bool bCreate = CefBrowserHost::CreateBrowser( info,static_cast<CefRefPtr<CefClient> >(client),
"http://www.baidu.com", browserSettings);
return 0;
}
示例5: NPP_SetWindowImpl
NPError NPP_SetWindowImpl(NPP instance, NPWindow* window_info) {
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
if (window_info == NULL)
return NPERR_GENERIC_ERROR;
ClientPlugin* plugin = reinterpret_cast<ClientPlugin*>(instance->pdata);
HWND parent_hwnd = reinterpret_cast<HWND>(window_info->window);
if (plugin->hWnd == NULL) {
WNDCLASS wc;
HINSTANCE hInstance = GetModuleHandle(NULL);
// Register the window class.
wc.style = CS_OWNDC;
wc.lpfnWndProc = PluginWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = L"ClientOSRPlugin";
RegisterClass(&wc);
// Create the main window.
plugin->hWnd = CreateWindow(L"ClientOSRPlugin", L"Client OSR Plugin",
WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, 0, 0, 0, 0, parent_hwnd, NULL,
hInstance, NULL);
SetWindowLongPtr(plugin->hWnd, GWLP_USERDATA,
reinterpret_cast<LONG_PTR>(plugin));
// Enable GL drawing for the window.
EnableGL(plugin->hWnd, &(plugin->hDC), &(plugin->hRC));
// Create the off-screen rendering window.
CefWindowInfo windowInfo;
CefBrowserSettings settings;
windowInfo.SetAsOffScreen(plugin->hWnd);
if (g_offscreenTransparent)
windowInfo.SetTransparentPainting(TRUE);
CefBrowser::CreateBrowser(windowInfo, new ClientOSRHandler(plugin),
"http://www.google.com", settings);
}
// Position the plugin window and make sure it's visible.
RECT parent_rect;
GetClientRect(parent_hwnd, &parent_rect);
SetWindowPos(plugin->hWnd, NULL, parent_rect.left, parent_rect.top,
parent_rect.right - parent_rect.left,
parent_rect.bottom - parent_rect.top, SWP_SHOWWINDOW);
UpdateWindow(plugin->hWnd);
ShowWindow(plugin->hWnd, SW_SHOW);
return NPERR_NO_ERROR;
}
示例6: NewWindow
TSharedPtr<IWebBrowserWindow> FWebBrowserSingleton::CreateBrowserWindow(void* OSWindowHandle, FString InitialURL, uint32 Width, uint32 Height, bool bUseTransparency, TOptional<FString> ContentsToLoad, bool ShowErrorMessage)
{
#if WITH_CEF3
// Create new window
TSharedPtr<FWebBrowserWindow> NewWindow(new FWebBrowserWindow(FIntPoint(Width, Height), InitialURL, ContentsToLoad, ShowErrorMessage));
// WebBrowserHandler implements browser-level callbacks.
CefRefPtr<FWebBrowserHandler> NewHandler(new FWebBrowserHandler);
NewWindow->SetHandler(NewHandler);
// Information used when creating the native window.
CefWindowHandle WindowHandle = (CefWindowHandle)OSWindowHandle; // TODO: check this is correct for all platforms
CefWindowInfo WindowInfo;
// Always use off screen rendering so we can integrate with our windows
WindowInfo.SetAsOffScreen(WindowHandle);
WindowInfo.SetTransparentPainting(bUseTransparency);
// Specify CEF browser settings here.
CefBrowserSettings BrowserSettings;
CefString URL = *InitialURL;
// Create the CEF browser window.
if (CefBrowserHost::CreateBrowser(WindowInfo, NewHandler.get(), URL, BrowserSettings, NULL))
{
WindowInterfaces.Add(NewWindow);
return NewWindow;
}
#endif
return NULL;
}
示例7: ClientHandler
// WM_CREATE handler
BOOL cef_main_window::HandleCreate()
{
// Create the single static handler class instance
g_handler = new ClientHandler();
g_handler->SetMainHwnd(mWnd);
RECT rect;
GetCefBrowserRect(rect);
CefWindowInfo info;
CefBrowserSettings settings;
settings.web_security = STATE_DISABLED;
// Initialize window info to the defaults for a child window
info.SetAsChild(mWnd, rect);
// Creat the new child browser window
CefBrowserHost::CreateBrowser(info,
static_cast<CefRefPtr<CefClient> >(g_handler),
::AppGetInitialURL(), settings);
return TRUE;
}
示例8: __showDev
void __showDev(HWND hWnd){
BrowserWindowInfo * bw = getBrowserWindowInfo(hWnd);
if (bw != NULL){
CefWindowInfo windowInfo;
windowInfo.SetAsPopup(NULL, "cef_debug");
bw->browser->GetHost()->ShowDevTools(windowInfo, new DEBUG_Handler(), CefBrowserSettings(), CefPoint());
}
}
示例9: ShowDevTools
void ClientHandler::ShowDevTools(CefRefPtr<CefBrowser> browser) {
CefWindowInfo windowInfo;
CefBrowserSettings settings;
#if defined(OS_WIN)
windowInfo.SetAsPopup(browser->GetHost()->GetWindowHandle(), "DevTools");
#endif
browser->GetHost()->ShowDevTools(windowInfo, this, settings);
}
示例10: SetWindowText
int CTransChatWebWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!theApp.GetWindowManager()->Attach(GetSafeHwnd(), _T("trans_chat_web_wnd")))
return -1;
SetWindowText(_T("专人翻译"));
g_SessionData.chat_hwnd = GetSafeHwnd();
m_shadow_win.create(GetSafeHwnd());
m_Recorder.Attach(GetSafeHwnd());
//m_pV8Exthandler = new ClientV8ExtHandler(this);
CefRefPtr<CefWebClient> client(new CefWebClient());
m_cWebClient = client;
CefSettings cSettings;
CefSettingsTraits::init(&cSettings);
cSettings.multi_threaded_message_loop = true;
CefRefPtr<CefApp> spApp;
CefInitialize(cSettings, spApp);
//CefRegisterExtension("v8/Ext", s_JsExt, m_pV8Exthandler);
duHwndObj* pWebHwndobj = (duHwndObj*)GetPluginByName(GetSafeHwnd(), _T("chat_web_hwndobj"));
RECT rc = { 0, 0, 0, 0 };
pWebHwndobj->GetRect(&rc);
CefWindowInfo info;
info.SetAsChild(GetSafeHwnd(), rc);
TCHAR szHtml[MAX_PATH] = { 0 };
::GetModuleFileName(GetModuleHandle(NULL), szHtml, _countof(szHtml));
::PathRemoveFileSpec(szHtml);
::PathAppend(szHtml, _T("html\\trans.html"));
CefBrowserSettings browserSettings;
CefBrowser::CreateBrowser(info, static_cast<CefRefPtr<CefClient>>(client),
szHtml, browserSettings);
InitExtension();
//RunExtensionTest(m_cWebClient->GetBrowser());
//pWebHwndobj->Attach(m_cWebClient->GetBrowser()->GetWindowHandle());
//m_Recorder.StartRecord();
//StrCpy(m_szVoicePath, _T("C:\\Users\\Administrator\\AppData\\Roaming\\MyEcho\\oDHO7Q3LRUtxLg4E9R1adjrsv5irzYa8\\task\\test.amr"));
return 0;
}
示例11: assert
bool WindowlessBoltBrowser::Create( HWND hHostWnd )
{
assert(hHostWnd);
assert(::IsWindow(hHostWnd));
CefWindowInfo info;
info.SetAsOffScreen(hHostWnd);
info.SetTransparentPainting(m_transparent? TRUE : FALSE);
return BaseBoltBrowser::Create(info);
}
示例12: ShowDevTools
inline void ShowDevTools(CWebClient * pthis, CefRefPtr<CefBrowser> browser,
const CefPoint& inspect_element_at) {
CefWindowInfo windowInfo;
CefBrowserSettings settings;
#if defined(OS_WIN)
windowInfo.SetAsPopup(browser->GetHost()->GetWindowHandle(), "DevTools");
#endif
browser->GetHost()->ShowDevTools(windowInfo, pthis, settings,
inspect_element_at);
}
示例13: ShowDevTools
bool ShowDevTools(CefRefPtr<CefBrowser> browser) {
CefWindowInfo windowInfo;
CefBrowserSettings settings;
#if defined(OS_WIN)
windowInfo.SetAsPopup(browser->GetHost()->GetWindowHandle(), "DevTools");
#endif
browser->GetHost()->ShowDevTools(windowInfo, browser->GetHost()->GetClient(),
settings, CefPoint());
return true;
}
示例14: HL_DEBUG
void Client::showDevTools( CefRefPtr<CefBrowser> browser )
{
std::stringstream ss;
ss << "showDevTools, id=" << browser->GetIdentifier();
HL_DEBUG(logger, ss.str());
CefWindowInfo windowInfo;
CefBrowserSettings settings;
#if defined(OS_WIN)
windowInfo.SetAsPopup(browser->GetHost()->GetWindowHandle(), "DevTools");
#endif
browser->GetHost()->ShowDevTools(windowInfo, this, settings, CefPoint());
}
示例15: RunTransparentPopupTest
void RunTransparentPopupTest(CefRefPtr<CefBrowser> browser) {
CefWindowInfo info;
CefBrowserSettings settings;
// Initialize window info to the defaults for a popup window
info.SetAsPopup(NULL, "TransparentPopup");
info.SetTransparentPainting(TRUE);
info.m_nWidth = 500;
info.m_nHeight = 500;
// Creat the popup browser window
CefBrowser::CreateBrowser(info,
static_cast<CefRefPtr<CefClient> >(g_handler),
"http://tests/transparency", settings);
}