summaryrefslogtreecommitdiffstats
path: root/content/browser/browser_plugin/browser_plugin_guest_helper.h
diff options
context:
space:
mode:
authorfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-18 23:26:07 +0000
committerfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-18 23:26:07 +0000
commita7fac9a7d2499bb667caddeb9cc5f46401d6bfc1 (patch)
tree40c5a493e76af9b06f02e952b6f7dcf568fe222f /content/browser/browser_plugin/browser_plugin_guest_helper.h
parent38366406aa46b50308a0720067c799f89c816316 (diff)
downloadchromium_src-a7fac9a7d2499bb667caddeb9cc5f46401d6bfc1.zip
chromium_src-a7fac9a7d2499bb667caddeb9cc5f46401d6bfc1.tar.gz
chromium_src-a7fac9a7d2499bb667caddeb9cc5f46401d6bfc1.tar.bz2
Browser Plugin: Simplify BrowserPluginGuestHelper
Since BrowserPlugin was first implemented, support for cross-process navigation was dropped but BrowserPlugin*Helper classes maintain a lot of complexity that was no longer necessary. This CL attempts to reduce some of this complexity by simplifying BrowserPluginGuestHelper. It is only needed now to intercept ViewHostMsg_* before arriving to RenderViewHost. It is still a separate class because RenderViewHostObserver's lifetime is managed by RenderViewHost and BrowserPluginGuest's lifetime is managed by WebContentsImpl. This refactor/simplification is a prerequisite to introducing a BrowserPluginGuestObserver class. Further changes will come in a subsequent CL to simplify the message routing from BrowserPluginEmbedderHelper --> BrowserPluginEmbedder --> BrowserPluginGuest BUG=166165 Test=BrowserPluginHostTest.* Review URL: https://codereview.chromium.org/11606005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173804 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/browser_plugin/browser_plugin_guest_helper.h')
-rw-r--r--content/browser/browser_plugin/browser_plugin_guest_helper.h28
1 files changed, 8 insertions, 20 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_guest_helper.h b/content/browser/browser_plugin/browser_plugin_guest_helper.h
index 0edac24..cb938c62 100644
--- a/content/browser/browser_plugin/browser_plugin_guest_helper.h
+++ b/content/browser/browser_plugin/browser_plugin_guest_helper.h
@@ -25,13 +25,12 @@ namespace content {
class BrowserPluginGuest;
class RenderViewHost;
-// Helper for browser plugin guest.
+// Helper for BrowserPluginGuest.
//
-// It overrides different WebContents messages that require special treatment
-// for a WebContents to act as a guest. All functionality is handled by its
-// delegate. This class exists so we have separation of messages requiring
-// special handling, which can be moved to a message filter (IPC thread) for
-// future optimization.
+// The purpose of this class is to intercept messages from the guest RenderView
+// before they are handled by the standard message handlers in the browser
+// process. This permits overriding standard behavior with BrowserPlugin-
+// specific behavior.
//
// The lifetime of this class is managed by the associated RenderViewHost. A
// BrowserPluginGuestHelper is created whenever a BrowserPluginGuest is created.
@@ -46,22 +45,11 @@ class BrowserPluginGuestHelper : public RenderViewHostObserver {
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
private:
- // Message handlers
- void OnUpdateDragCursor(WebKit::WebDragOperation current_op);
- void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params);
- void OnHandleInputEventAck(WebKit::WebInputEvent::Type event_type,
- InputEventAckState ack_result);
- void OnTakeFocus(bool reverse);
- void OnShowWidget(int route_id, const gfx::Rect& initial_pos);
- void OnMsgHasTouchEventHandlers(bool has_handlers);
- void OnSetCursor(const WebCursor& cursor);
-#if defined(OS_MACOSX)
- void OnShowPopup(const ViewHostMsg_ShowPopup_Params& params);
-#endif
+ // Returns whether a message should be forward to the helper's associated
+ // BrowserPluginGuest.
+ static bool ShouldForwardToBrowserPluginGuest(const IPC::Message& message);
BrowserPluginGuest* guest_;
- // A scoped container for notification registries.
- NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuestHelper);
};