Remove the legacy off-screen rendering implementation. A new implementation is required (issue #1257).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1678 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2014-04-25 01:36:58 +00:00
parent 1e239187a2
commit f6bc617bc5
84 changed files with 73 additions and 8457 deletions

View File

@@ -267,12 +267,10 @@ bool CefBrowserImpl::SendProcessMessage(CefProcessId target_process,
CefBrowserImpl::CefBrowserImpl(content::RenderView* render_view,
int browser_id,
bool is_popup,
bool is_window_rendering_disabled)
bool is_popup)
: content::RenderViewObserver(render_view),
browser_id_(browser_id),
is_popup_(is_popup),
is_window_rendering_disabled_(is_window_rendering_disabled),
last_focused_frame_id_(webkit_glue::kInvalidFrameId) {
response_manager_.reset(new CefResponseManager);
}

View File

@@ -79,8 +79,7 @@ class CefBrowserImpl : public CefBrowser,
CefBrowserImpl(content::RenderView* render_view,
int browser_id,
bool is_popup,
bool is_window_rendering_disabled);
bool is_popup);
virtual ~CefBrowserImpl();
void LoadRequest(const CefMsg_LoadRequest_Params& params);
@@ -100,9 +99,6 @@ class CefBrowserImpl : public CefBrowser,
int browser_id() const { return browser_id_; }
bool is_popup() const { return is_popup_; }
bool is_window_rendering_disabled() const {
return is_window_rendering_disabled_;
}
content::RenderView* render_view() const {
return content::RenderViewObserver::render_view();
}
@@ -144,7 +140,6 @@ class CefBrowserImpl : public CefBrowser,
// same browser ID.
int browser_id_;
bool is_popup_;
bool is_window_rendering_disabled_;
// Id of the last frame that had focus.
int64 last_focused_frame_id_;

View File

@@ -436,90 +436,6 @@ void CefContentRendererClient::RenderViewCreated(
BrowserCreated(render_view, render_view->GetMainRenderFrame());
}
bool CefContentRendererClient::OverrideCreatePlugin(
content::RenderFrame* render_frame,
blink::WebFrame* frame,
const blink::WebPluginParams& params,
blink::WebPlugin** plugin) {
CefRefPtr<CefBrowserImpl> browser =
CefBrowserImpl::GetBrowserForMainFrame(frame->top());
if (!browser || !browser->is_window_rendering_disabled())
return false;
#if defined(ENABLE_PLUGINS)
if (base::UTF16ToASCII(params.mimeType) == content::kBrowserPluginMimeType)
return false;
content::RenderFrameImpl* render_frame_impl =
static_cast<content::RenderFrameImpl*>(render_frame);
content::WebPluginInfo info;
std::string mime_type;
bool found = false;
render_frame_impl->Send(
new FrameHostMsg_GetPluginInfo(
render_frame_impl->GetRoutingID(),
params.url,
frame->top()->document().url(),
params.mimeType.utf8(),
&found,
&info,
&mime_type));
if (!found)
return false;
bool flash = LowerCaseEqualsASCII(mime_type,
"application/x-shockwave-flash");
bool silverlight = StartsWithASCII(mime_type,
"application/x-silverlight", false);
if (flash) {
// "wmode" values of "opaque" or "transparent" are allowed.
size_t size = params.attributeNames.size();
for (size_t i = 0; i < size; ++i) {
std::string name = params.attributeNames[i].utf8();
if (name == "wmode") {
std::string value = params.attributeValues[i].utf8();
if (value == "opaque" || value == "transparent")
flash = false;
break;
}
}
}
if (flash || silverlight) {
// Force Flash and Silverlight plugins to use windowless mode.
blink::WebPluginParams params_to_use = params;
params_to_use.mimeType = blink::WebString::fromUTF8(mime_type);
size_t size = params.attributeNames.size();
blink::WebVector<blink::WebString> new_names(size+1),
new_values(size+1);
for (size_t i = 0; i < size; ++i) {
new_names[i] = params.attributeNames[i];
new_values[i] = params.attributeValues[i];
}
if (flash) {
new_names[size] = "wmode";
new_values[size] = "opaque";
} else if (silverlight) {
new_names[size] = "windowless";
new_values[size] = "true";
}
params_to_use.attributeNames.swap(new_names);
params_to_use.attributeValues.swap(new_values);
*plugin = render_frame_impl->CreatePlugin(frame, info, params_to_use);
return true;
}
#endif // defined(ENABLE_PLUGINS)
return false;
}
bool CefContentRendererClient::HandleNavigation(
content::RenderFrame* render_frame,
content::DocumentState* document_state,
@@ -662,18 +578,8 @@ void CefContentRendererClient::BrowserCreated(
if (GetBrowserForView(render_view))
return;
#if defined(OS_MACOSX)
// FIXME: It would be better if this API would be a callback from the
// WebKit layer, or if it would be exposed as an WebView instance method; the
// current implementation uses a static variable, and WebKit needs to be
// patched in order to make it work for each WebView instance
render_view->GetWebView()->setUseExternalPopupMenusThisInstance(
!params.is_window_rendering_disabled);
#endif
CefRefPtr<CefBrowserImpl> browser =
new CefBrowserImpl(render_view, params.browser_id, params.is_popup,
params.is_window_rendering_disabled);
new CefBrowserImpl(render_view, params.browser_id, params.is_popup);
browsers_.insert(std::make_pair(render_view, browser));
new CefPrerendererClient(render_view);

View File

@@ -76,11 +76,6 @@ class CefContentRendererClient : public content::ContentRendererClient,
virtual void RenderThreadStarted() OVERRIDE;
virtual void RenderFrameCreated(content::RenderFrame* render_frame) OVERRIDE;
virtual void RenderViewCreated(content::RenderView* render_view) OVERRIDE;
virtual bool OverrideCreatePlugin(
content::RenderFrame* render_frame,
blink::WebFrame* frame,
const blink::WebPluginParams& params,
blink::WebPlugin** plugin) OVERRIDE;
virtual bool HandleNavigation(content::RenderFrame* render_frame,
content::DocumentState* document_state,
int opener_id,