summaryrefslogtreecommitdiffstats
path: root/content/browser/browser_plugin
diff options
context:
space:
mode:
authorfsamuel <fsamuel@chromium.org>2014-09-20 09:57:58 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-20 16:58:11 +0000
commit516005f409bc6d2221c4be32fe1c0920975cf1ae (patch)
tree09f7f6e56f593e368eb1514ede7e53404131c622 /content/browser/browser_plugin
parent0394320b458343d2ce133403f479c344fffaeb06 (diff)
downloadchromium_src-516005f409bc6d2221c4be32fe1c0920975cf1ae.zip
chromium_src-516005f409bc6d2221c4be32fe1c0920975cf1ae.tar.gz
chromium_src-516005f409bc6d2221c4be32fe1c0920975cf1ae.tar.bz2
Browser Plugin: Remove dependency on NPAPI
The CL moves the final attribute on BrowserPlugin 'allowtransparency' out to the extensions module! No new content APIs had to be introduced! Transparency can be enabled from RenderWidgetHostView::SetBackgroundOpaque in the content embedder. This means that BrowserPlugin no longer depends on NPAPI and so this patch removes a lot of unnecessary code. TBR=asvitkine@chromium.org for histograms.xml, extension_function_histogram_value.h TBR=asvitkine@chromium.org for histograms.xml, extension BUG=330264 Review URL: https://codereview.chromium.org/584713002 Cr-Commit-Position: refs/heads/master@{#295879}
Diffstat (limited to 'content/browser/browser_plugin')
-rw-r--r--content/browser/browser_plugin/browser_plugin_guest.cc19
-rw-r--r--content/browser/browser_plugin/browser_plugin_guest.h4
2 files changed, 8 insertions, 15 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 992bccc..1d23397 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -80,7 +80,6 @@ BrowserPluginGuest::BrowserPluginGuest(bool has_render_view,
mouse_locked_(false),
pending_lock_request_(false),
guest_visible_(false),
- guest_opaque_(true),
embedder_visible_(true),
copy_request_id_(0),
has_render_view_(has_render_view),
@@ -183,8 +182,6 @@ bool BrowserPluginGuest::OnMessageReceivedFromEmbedder(
IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetEditCommandsForNextKeyEvent,
OnSetEditCommandsForNextKeyEvent)
IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetFocus, OnSetFocus)
- IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetContentsOpaque,
- OnSetContentsOpaque)
IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetVisibility, OnSetVisibility)
IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_UnlockMouse_ACK, OnUnlockMouseAck)
IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_UpdateGeometry, OnUpdateGeometry)
@@ -200,7 +197,6 @@ void BrowserPluginGuest::Initialize(
browser_plugin_instance_id_ = browser_plugin_instance_id;
focused_ = params.focused;
guest_visible_ = params.visible;
- guest_opaque_ = params.opaque;
guest_window_rect_ = gfx::Rect(params.origin,
params.resize_guest_params.view_size);
@@ -371,6 +367,12 @@ void BrowserPluginGuest::SwapCompositorFrame(
browser_plugin_instance_id(), guest_params));
}
+void BrowserPluginGuest::SetContentsOpaque(bool opaque) {
+ SendMessageToEmbedder(
+ new BrowserPluginMsg_SetContentsOpaque(
+ browser_plugin_instance_id(), opaque));
+}
+
WebContentsImpl* BrowserPluginGuest::GetWebContents() const {
return static_cast<WebContentsImpl*>(web_contents());
}
@@ -441,8 +443,6 @@ void BrowserPluginGuest::RenderViewReady() {
Send(new InputMsg_SetFocus(routing_id(), focused_));
UpdateVisibility();
- OnSetContentsOpaque(browser_plugin_instance_id(), guest_opaque_);
-
RenderWidgetHostImpl::From(rvh)->set_hung_renderer_delay_ms(
base::TimeDelta::FromMilliseconds(kHungRendererDelayMs));
}
@@ -484,7 +484,6 @@ bool BrowserPluginGuest::ShouldForwardToBrowserPluginGuest(
case BrowserPluginHostMsg_ResizeGuest::ID:
case BrowserPluginHostMsg_SetEditCommandsForNextKeyEvent::ID:
case BrowserPluginHostMsg_SetFocus::ID:
- case BrowserPluginHostMsg_SetContentsOpaque::ID:
case BrowserPluginHostMsg_SetVisibility::ID:
case BrowserPluginHostMsg_UnlockMouse_ACK::ID:
case BrowserPluginHostMsg_UpdateGeometry::ID:
@@ -730,12 +729,6 @@ void BrowserPluginGuest::OnSetEditCommandsForNextKeyEvent(
edit_commands));
}
-void BrowserPluginGuest::OnSetContentsOpaque(int browser_plugin_instance_id,
- bool opaque) {
- guest_opaque_ = opaque;
- Send(new ViewMsg_SetBackgroundOpaque(routing_id(), guest_opaque_));
-}
-
void BrowserPluginGuest::OnSetVisibility(int browser_plugin_instance_id,
bool visible) {
guest_visible_ = visible;
diff --git a/content/browser/browser_plugin/browser_plugin_guest.h b/content/browser/browser_plugin/browser_plugin_guest.h
index 13aed33..cecca6d 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.h
+++ b/content/browser/browser_plugin/browser_plugin_guest.h
@@ -203,6 +203,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsObserver {
int host_routing_id,
scoped_ptr<cc::CompositorFrame> frame);
+ void SetContentsOpaque(bool opaque);
+
private:
class EmbedderWebContentsObserver;
@@ -263,7 +265,6 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsObserver {
void OnSetEditCommandsForNextKeyEvent(
int instance_id,
const std::vector<EditCommand>& edit_commands);
- void OnSetContentsOpaque(int instance_id, bool opaque);
// The guest WebContents is visible if both its embedder is visible and
// the browser plugin element is visible. If either one is not then the
// WebContents is marked as hidden. A hidden WebContents will consume
@@ -336,7 +337,6 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsObserver {
bool mouse_locked_;
bool pending_lock_request_;
bool guest_visible_;
- bool guest_opaque_;
bool embedder_visible_;
// Each copy-request is identified by a unique number. The unique number is