mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Move the |use_osr_next_contents_view| attribute from CefBrowserContext to CefContentBrowserClient.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1422 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -189,8 +189,7 @@ class CefBrowserContext::CefResourceContext : public content::ResourceContext {
|
|||||||
};
|
};
|
||||||
|
|
||||||
CefBrowserContext::CefBrowserContext()
|
CefBrowserContext::CefBrowserContext()
|
||||||
: resource_context_(new CefResourceContext),
|
: resource_context_(new CefResourceContext) {
|
||||||
use_osr_next_contents_view_(false) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CefBrowserContext::~CefBrowserContext() {
|
CefBrowserContext::~CefBrowserContext() {
|
||||||
@ -299,11 +298,3 @@ net::URLRequestContextGetter*
|
|||||||
content::ProtocolHandlerMap* protocol_handlers) {
|
content::ProtocolHandlerMap* protocol_handlers) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefBrowserContext::use_osr_next_contents_view() const {
|
|
||||||
return use_osr_next_contents_view_;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CefBrowserContext::set_use_osr_next_contents_view(bool override) {
|
|
||||||
use_osr_next_contents_view_ = override;
|
|
||||||
}
|
|
||||||
|
@ -58,13 +58,6 @@ class CefBrowserContext : public content::BrowserContext {
|
|||||||
bool in_memory,
|
bool in_memory,
|
||||||
content::ProtocolHandlerMap* protocol_handlers);
|
content::ProtocolHandlerMap* protocol_handlers);
|
||||||
|
|
||||||
// To disable window rendering call this function with |override|=true
|
|
||||||
// just before calling WebContents::Create. This will cause
|
|
||||||
// CefContentBrowserClient::OverrideCreateWebContentsView to create
|
|
||||||
// a windowless WebContentsView object.
|
|
||||||
void set_use_osr_next_contents_view(bool override);
|
|
||||||
bool use_osr_next_contents_view() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class CefResourceContext;
|
class CefResourceContext;
|
||||||
|
|
||||||
@ -74,8 +67,6 @@ class CefBrowserContext : public content::BrowserContext {
|
|||||||
scoped_refptr<content::GeolocationPermissionContext>
|
scoped_refptr<content::GeolocationPermissionContext>
|
||||||
geolocation_permission_context_;
|
geolocation_permission_context_;
|
||||||
|
|
||||||
bool use_osr_next_contents_view_;
|
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefBrowserContext);
|
DISALLOW_COPY_AND_ASSIGN(CefBrowserContext);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ CefRefPtr<CefBrowser> CefBrowserHost::CreateBrowserSync(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_Context->browser_context()->set_use_osr_next_contents_view(
|
CefContentBrowserClient::Get()->set_use_osr_next_contents_view(
|
||||||
CefBrowserHostImpl::IsWindowRenderingDisabled(windowInfo));
|
CefBrowserHostImpl::IsWindowRenderingDisabled(windowInfo));
|
||||||
|
|
||||||
scoped_refptr<CefBrowserInfo> info =
|
scoped_refptr<CefBrowserInfo> info =
|
||||||
@ -1661,7 +1661,7 @@ bool CefBrowserHostImpl::ShouldCreateWebContents(
|
|||||||
// OpenURLFromTab will be called after WebContentsCreated.
|
// OpenURLFromTab will be called after WebContentsCreated.
|
||||||
base::AutoLock lock_scope(pending_popup_info_lock_);
|
base::AutoLock lock_scope(pending_popup_info_lock_);
|
||||||
DCHECK(pending_popup_info_.get());
|
DCHECK(pending_popup_info_.get());
|
||||||
_Context->browser_context()->set_use_osr_next_contents_view(
|
CefContentBrowserClient::Get()->set_use_osr_next_contents_view(
|
||||||
IsWindowRenderingDisabled(pending_popup_info_->window_info));
|
IsWindowRenderingDisabled(pending_popup_info_->window_info));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -281,7 +281,8 @@ void TranslatePopupFeatures(const WebKit::WebWindowFeatures& webKitFeatures,
|
|||||||
|
|
||||||
CefContentBrowserClient::CefContentBrowserClient()
|
CefContentBrowserClient::CefContentBrowserClient()
|
||||||
: browser_main_parts_(NULL),
|
: browser_main_parts_(NULL),
|
||||||
next_browser_id_(0) {
|
next_browser_id_(0),
|
||||||
|
use_osr_next_contents_view_(false) {
|
||||||
plugin_service_filter_.reset(new CefPluginServiceFilter);
|
plugin_service_filter_.reset(new CefPluginServiceFilter);
|
||||||
content::PluginServiceImpl::GetInstance()->SetFilter(
|
content::PluginServiceImpl::GetInstance()->SetFilter(
|
||||||
plugin_service_filter_.get());
|
plugin_service_filter_.get());
|
||||||
@ -406,10 +407,7 @@ CefContentBrowserClient::OverrideCreateWebContentsView(
|
|||||||
content::WebContentsViewPort* view = NULL;
|
content::WebContentsViewPort* view = NULL;
|
||||||
*render_view_host_delegate_view = NULL;
|
*render_view_host_delegate_view = NULL;
|
||||||
|
|
||||||
CefBrowserContext* browserContext =
|
if (use_osr_next_contents_view()) {
|
||||||
static_cast<CefBrowserContext*>(web_contents->GetBrowserContext());
|
|
||||||
|
|
||||||
if (browserContext && browserContext->use_osr_next_contents_view()) {
|
|
||||||
CefWebContentsViewOSR* view_or = new CefWebContentsViewOSR(web_contents,
|
CefWebContentsViewOSR* view_or = new CefWebContentsViewOSR(web_contents,
|
||||||
GetWebContentsViewDelegate(web_contents));
|
GetWebContentsViewDelegate(web_contents));
|
||||||
*render_view_host_delegate_view = view_or;
|
*render_view_host_delegate_view = view_or;
|
||||||
|
@ -135,6 +135,16 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
|||||||
};
|
};
|
||||||
void set_last_create_window_params(const LastCreateWindowParams& params);
|
void set_last_create_window_params(const LastCreateWindowParams& params);
|
||||||
|
|
||||||
|
// To disable window rendering call this function with |override|=true
|
||||||
|
// just before calling WebContents::Create. This will cause
|
||||||
|
// OverrideCreateWebContentsView to create a windowless WebContentsView.
|
||||||
|
void set_use_osr_next_contents_view(bool value) {
|
||||||
|
use_osr_next_contents_view_ = value;
|
||||||
|
}
|
||||||
|
bool use_osr_next_contents_view() const {
|
||||||
|
return use_osr_next_contents_view_;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CefBrowserContext* CefBrowserContextForBrowserContext(
|
CefBrowserContext* CefBrowserContextForBrowserContext(
|
||||||
content::BrowserContext* content_browser_context);
|
content::BrowserContext* content_browser_context);
|
||||||
@ -154,6 +164,8 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
|||||||
|
|
||||||
// Only accessed on the IO thread.
|
// Only accessed on the IO thread.
|
||||||
LastCreateWindowParams last_create_window_params_;
|
LastCreateWindowParams last_create_window_params_;
|
||||||
|
|
||||||
|
bool use_osr_next_contents_view_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_BROWSER_CONTENT_BROWSER_CLIENT_H_
|
#endif // CEF_LIBCEF_BROWSER_CONTENT_BROWSER_CLIENT_H_
|
||||||
|
Reference in New Issue
Block a user