Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1567)

Unified Diff: content/renderer/browser_plugin/browser_plugin_manager_impl.cc

Issue 11416074: Browser Plugin: Simplified BrowserPluginManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/browser_plugin/browser_plugin_manager_impl.cc
diff --git a/content/renderer/browser_plugin/browser_plugin_manager_impl.cc b/content/renderer/browser_plugin/browser_plugin_manager_impl.cc
index 63143daab0664c053ffe7eeabee448dc88abe98b..bfca48aa57102889bbd6a9e7d7ff5657f537eac9 100644
--- a/content/renderer/browser_plugin/browser_plugin_manager_impl.cc
+++ b/content/renderer/browser_plugin/browser_plugin_manager_impl.cc
@@ -12,7 +12,9 @@
namespace content {
-BrowserPluginManagerImpl::BrowserPluginManagerImpl() {
+BrowserPluginManagerImpl::BrowserPluginManagerImpl(
+ RenderViewImpl* render_view)
+ : BrowserPluginManager(render_view) {
}
BrowserPluginManagerImpl::~BrowserPluginManagerImpl() {
@@ -32,9 +34,8 @@ bool BrowserPluginManagerImpl::Send(IPC::Message* msg) {
return RenderThread::Get()->Send(msg);
}
-bool BrowserPluginManagerImpl::OnControlMessageReceived(
+bool BrowserPluginManagerImpl::OnMessageReceived(
const IPC::Message& message) {
- DCHECK(CalledOnValidThread());
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(BrowserPluginManagerImpl, message)
IPC_MESSAGE_HANDLER(BrowserPluginMsg_UpdateRect, OnUpdateRect)
@@ -58,16 +59,17 @@ bool BrowserPluginManagerImpl::OnControlMessageReceived(
}
void BrowserPluginManagerImpl::OnPluginAtPositionRequest(
- int source_routing_id, int request_id, const gfx::Point& position) {
+ int request_id, const gfx::Point& position) {
int instance_id = -1;
IDMap<BrowserPlugin>::iterator it(&instances_);
gfx::Point local_position = position;
+ int source_routing_id = -1;
while (!it.IsAtEnd()) {
const BrowserPlugin* plugin = it.GetCurrentValue();
// We need to check the plugin's routing id too since BrowserPluginManager
// can manage plugins from other embedder (in the same process).
- if (plugin->render_view_routing_id() == source_routing_id &&
- plugin->InBounds(position)) {
+ if (plugin->InBounds(position)) {
+ source_routing_id = plugin->render_view_routing_id();
instance_id = plugin->instance_id();
local_position = plugin->ToLocalCoordinates(position);
break;
@@ -76,10 +78,10 @@ void BrowserPluginManagerImpl::OnPluginAtPositionRequest(
}
Send(new BrowserPluginHostMsg_PluginAtPositionResponse(
- source_routing_id,
- instance_id,
- request_id,
- local_position));
+ source_routing_id,
+ instance_id,
+ request_id,
+ local_position));
}
void BrowserPluginManagerImpl::OnUpdateRect(

Powered by Google App Engine
This is Rietveld 408576698