mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add |extra_info| parameter for browser creation (fixes issue #1088)
The optional |extra_info| parameter provides an opportunity to specify extra information specific to the created browser that will be passed to CefRenderProcessHandler::OnBrowserCreated() in the render process.
This commit is contained in:
committed by
Marshall Greenblatt
parent
ad4ce5f441
commit
473c29a70d
@@ -357,14 +357,15 @@ void TestHandler::OnTestTimeout(int timeout_ms, bool treat_as_error) {
|
||||
}
|
||||
|
||||
void TestHandler::CreateBrowser(const CefString& url,
|
||||
CefRefPtr<CefRequestContext> request_context) {
|
||||
CefRefPtr<CefRequestContext> request_context,
|
||||
CefRefPtr<CefDictionaryValue> extra_info) {
|
||||
#if defined(USE_AURA)
|
||||
const bool use_views = CefCommandLine::GetGlobalCommandLine()->HasSwitch(
|
||||
client::switches::kUseViews);
|
||||
if (use_views && !CefCurrentlyOn(TID_UI)) {
|
||||
// Views classes must be accessed on the UI thread.
|
||||
CefPostTask(TID_UI, base::Bind(&TestHandler::CreateBrowser, this, url,
|
||||
request_context));
|
||||
request_context, extra_info));
|
||||
return;
|
||||
}
|
||||
#endif // defined(USE_AURA)
|
||||
@@ -377,7 +378,8 @@ void TestHandler::CreateBrowser(const CefString& url,
|
||||
if (use_views) {
|
||||
// Create the BrowserView.
|
||||
CefRefPtr<CefBrowserView> browser_view = CefBrowserView::CreateBrowserView(
|
||||
this, url, settings, request_context, new TestBrowserViewDelegate());
|
||||
this, url, settings, extra_info, request_context,
|
||||
new TestBrowserViewDelegate());
|
||||
|
||||
// Create the Window. It will show itself after creation.
|
||||
TestWindowDelegate::CreateBrowserWindow(browser_view, std::string());
|
||||
@@ -388,7 +390,7 @@ void TestHandler::CreateBrowser(const CefString& url,
|
||||
windowInfo.SetAsPopup(NULL, "CefUnitTest");
|
||||
windowInfo.style |= WS_VISIBLE;
|
||||
#endif
|
||||
CefBrowserHost::CreateBrowser(windowInfo, this, url, settings,
|
||||
CefBrowserHost::CreateBrowser(windowInfo, this, url, settings, extra_info,
|
||||
request_context);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user