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:
parent
a865b25a2d
commit
935a35f21c
|
@ -189,8 +189,7 @@ class CefBrowserContext::CefResourceContext : public content::ResourceContext {
|
|||
};
|
||||
|
||||
CefBrowserContext::CefBrowserContext()
|
||||
: resource_context_(new CefResourceContext),
|
||||
use_osr_next_contents_view_(false) {
|
||||
: resource_context_(new CefResourceContext) {
|
||||
}
|
||||
|
||||
CefBrowserContext::~CefBrowserContext() {
|
||||
|
@ -299,11 +298,3 @@ net::URLRequestContextGetter*
|
|||
content::ProtocolHandlerMap* protocol_handlers) {
|
||||
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,
|
||||
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:
|
||||
class CefResourceContext;
|
||||
|
||||
|
@ -74,8 +67,6 @@ class CefBrowserContext : public content::BrowserContext {
|
|||
scoped_refptr<content::GeolocationPermissionContext>
|
||||
geolocation_permission_context_;
|
||||
|
||||
bool use_osr_next_contents_view_;
|
||||
|
||||
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));
|
||||
|
||||
scoped_refptr<CefBrowserInfo> info =
|
||||
|
@ -1661,7 +1661,7 @@ bool CefBrowserHostImpl::ShouldCreateWebContents(
|
|||
// OpenURLFromTab will be called after WebContentsCreated.
|
||||
base::AutoLock lock_scope(pending_popup_info_lock_);
|
||||
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));
|
||||
|
||||
return true;
|
||||
|
|
|
@ -281,7 +281,8 @@ void TranslatePopupFeatures(const WebKit::WebWindowFeatures& webKitFeatures,
|
|||
|
||||
CefContentBrowserClient::CefContentBrowserClient()
|
||||
: browser_main_parts_(NULL),
|
||||
next_browser_id_(0) {
|
||||
next_browser_id_(0),
|
||||
use_osr_next_contents_view_(false) {
|
||||
plugin_service_filter_.reset(new CefPluginServiceFilter);
|
||||
content::PluginServiceImpl::GetInstance()->SetFilter(
|
||||
plugin_service_filter_.get());
|
||||
|
@ -406,10 +407,7 @@ CefContentBrowserClient::OverrideCreateWebContentsView(
|
|||
content::WebContentsViewPort* view = NULL;
|
||||
*render_view_host_delegate_view = NULL;
|
||||
|
||||
CefBrowserContext* browserContext =
|
||||
static_cast<CefBrowserContext*>(web_contents->GetBrowserContext());
|
||||
|
||||
if (browserContext && browserContext->use_osr_next_contents_view()) {
|
||||
if (use_osr_next_contents_view()) {
|
||||
CefWebContentsViewOSR* view_or = new CefWebContentsViewOSR(web_contents,
|
||||
GetWebContentsViewDelegate(web_contents));
|
||||
*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);
|
||||
|
||||
// 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:
|
||||
CefBrowserContext* CefBrowserContextForBrowserContext(
|
||||
content::BrowserContext* content_browser_context);
|
||||
|
@ -154,6 +164,8 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
|
|||
|
||||
// Only accessed on the IO thread.
|
||||
LastCreateWindowParams last_create_window_params_;
|
||||
|
||||
bool use_osr_next_contents_view_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_CONTENT_BROWSER_CLIENT_H_
|
||||
|
|
Loading…
Reference in New Issue