diff options
author | kaznacheev@chromium.org <kaznacheev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-07 18:58:25 +0000 |
---|---|---|
committer | kaznacheev@chromium.org <kaznacheev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-07 18:58:25 +0000 |
commit | 1a290104b9cbdbdd664798b53bddcfc416acb141 (patch) | |
tree | 93893c6c5a17080bc72d490d80a1dbcc0b38e9f7 /content/renderer/browser_plugin | |
parent | bca6ab997a6e5b79f6d3ef37016c947185794433 (diff) | |
download | chromium_src-1a290104b9cbdbdd664798b53bddcfc416acb141.zip chromium_src-1a290104b9cbdbdd664798b53bddcfc416acb141.tar.gz chromium_src-1a290104b9cbdbdd664798b53bddcfc416acb141.tar.bz2 |
DevTools: Fix Inspect Element action for OOP iframes.
RenderViewContextMenu has recently become aware of the frame it is being called for. This makes it possible direct the InspectElement message to the correct renderer which is necessary of the "Inspect Element" action to work correctly with OOP iframes.
This automatically works correctly for BrowserPlugin as well, so WebContents::GetRenderViewHostAtPosition and all supporting code across can be removed now.
BUG=345700
Review URL: https://codereview.chromium.org/187673004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255672 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/browser_plugin')
4 files changed, 0 insertions, 55 deletions
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc index 3d20a6e..587412b 100644 --- a/content/renderer/browser_plugin/browser_plugin.cc +++ b/content/renderer/browser_plugin/browser_plugin.cc @@ -1024,27 +1024,6 @@ void BrowserPlugin::paint(WebCanvas* canvas, const WebRect& rect) { canvas->drawBitmap(backing_store_->GetBitmap(), 0, 0); } -bool BrowserPlugin::InBounds(const gfx::Point& position) const { - // Note that even for plugins that are rotated using rotate transformations, - // we use the the |plugin_rect_| provided by updateGeometry, which means we - // will be off if |position| is within the plugin rect but does not fall - // within the actual plugin boundary. Not supporting such edge case is OK - // since this function should not be used for making security-sensitive - // decisions. - // This also does not take overlapping plugins into account. - bool result = position.x() >= plugin_rect_.x() && - position.x() < plugin_rect_.x() + plugin_rect_.width() && - position.y() >= plugin_rect_.y() && - position.y() < plugin_rect_.y() + plugin_rect_.height(); - return result; -} - -gfx::Point BrowserPlugin::ToLocalCoordinates(const gfx::Point& point) const { - if (container_) - return container_->windowToLocalPoint(blink::WebPoint(point)); - return gfx::Point(point.x() - plugin_rect_.x(), point.y() - plugin_rect_.y()); -} - // static bool BrowserPlugin::ShouldForwardToBrowserPlugin( const IPC::Message& message) { diff --git a/content/renderer/browser_plugin/browser_plugin.h b/content/renderer/browser_plugin/browser_plugin.h index 0c280e4..8079210 100644 --- a/content/renderer/browser_plugin/browser_plugin.h +++ b/content/renderer/browser_plugin/browser_plugin.h @@ -126,14 +126,6 @@ class CONTENT_EXPORT BrowserPlugin : // A request to enable hardware compositing. void EnableCompositing(bool enable); - // Returns true if |point| lies within the bounds of the plugin rectangle. - // Not OK to use this function for making security-sensitive decision since it - // can return false positives when the plugin has rotation transformation - // applied. - bool InBounds(const gfx::Point& point) const; - - gfx::Point ToLocalCoordinates(const gfx::Point& point) const; - // Called when a guest instance ID has been allocated by the browser process. void OnInstanceIDAllocated(int guest_instance_id); // Provided that a guest instance ID has been allocated, this method attaches diff --git a/content/renderer/browser_plugin/browser_plugin_manager_impl.cc b/content/renderer/browser_plugin/browser_plugin_manager_impl.cc index 542af45..9cfc9e8 100644 --- a/content/renderer/browser_plugin/browser_plugin_manager_impl.cc +++ b/content/renderer/browser_plugin/browser_plugin_manager_impl.cc @@ -59,8 +59,6 @@ bool BrowserPluginManagerImpl::OnMessageReceived( IPC_BEGIN_MESSAGE_MAP(BrowserPluginManagerImpl, message) IPC_MESSAGE_HANDLER(BrowserPluginMsg_AllocateInstanceID_ACK, OnAllocateInstanceIDACK) - IPC_MESSAGE_HANDLER(BrowserPluginMsg_PluginAtPositionRequest, - OnPluginAtPositionRequest); IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -90,25 +88,4 @@ void BrowserPluginManagerImpl::OnAllocateInstanceIDACK( plugin->OnInstanceIDAllocated(guest_instance_id); } -void BrowserPluginManagerImpl::OnPluginAtPositionRequest( - const IPC::Message& message, - int request_id, - const gfx::Point& position) { - int guest_instance_id = browser_plugin::kInstanceIDNone; - IDMap<BrowserPlugin>::iterator it(&instances_); - gfx::Point local_position = position; - while (!it.IsAtEnd()) { - const BrowserPlugin* plugin = it.GetCurrentValue(); - if (!plugin->guest_crashed() && plugin->InBounds(position)) { - guest_instance_id = plugin->guest_instance_id(); - local_position = plugin->ToLocalCoordinates(position); - break; - } - it.Advance(); - } - - Send(new BrowserPluginHostMsg_PluginAtPositionResponse( - message.routing_id(), guest_instance_id, request_id, local_position)); -} - } // namespace content diff --git a/content/renderer/browser_plugin/browser_plugin_manager_impl.h b/content/renderer/browser_plugin/browser_plugin_manager_impl.h index a046995..bc47cc8 100644 --- a/content/renderer/browser_plugin/browser_plugin_manager_impl.h +++ b/content/renderer/browser_plugin/browser_plugin_manager_impl.h @@ -40,9 +40,6 @@ class BrowserPluginManagerImpl : public BrowserPluginManager { void OnAllocateInstanceIDACK(const IPC::Message& message, int request_id, int guest_instance_id); - void OnPluginAtPositionRequest(const IPC::Message& message, - int request_id, - const gfx::Point& position); int request_id_counter_; typedef std::map<int, const base::WeakPtr<BrowserPlugin> > InstanceIDMap; |