diff options
author | lazyboy@chromium.org <lazyboy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-20 19:17:39 +0000 |
---|---|---|
committer | lazyboy@chromium.org <lazyboy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-20 19:17:39 +0000 |
commit | 7a846df3cdb848d4f87ab52bbebf95d16660d494 (patch) | |
tree | 1e2dc216f31a696da741e2833fd69ba97c61cf8f /content/browser/browser_plugin/browser_plugin_guest_helper.h | |
parent | 1aedaaa08397171253d1aa0a99951d96a52fe2a9 (diff) | |
download | chromium_src-7a846df3cdb848d4f87ab52bbebf95d16660d494.zip chromium_src-7a846df3cdb848d4f87ab52bbebf95d16660d494.tar.gz chromium_src-7a846df3cdb848d4f87ab52bbebf95d16660d494.tar.bz2 |
This is followup from Charlie's comments on Fady's cl: http://chromiumcodereview.appspot.com/10560022, it seems I cannot upload patch to that issue (since I'm not owner), I'm creating a new one.
Split Embedder and Guest 'roles' for browser plugin, web contents can now play any or both roles, main idea is to have more readable separation between the two.
Also stop creating browser_plugin counterpart in browser/host for every web_contents, instead create them only when there's a browser_plugin element.
BUG= 141232
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=157650
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=157773
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/10868012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157808 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.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_guest_helper.h b/content/browser/browser_plugin/browser_plugin_guest_helper.h new file mode 100644 index 0000000..19b3c7c --- /dev/null +++ b/content/browser/browser_plugin/browser_plugin_guest_helper.h @@ -0,0 +1,61 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_HELPER_H_ +#define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_HELPER_H_ + +#include "content/public/browser/render_view_host_observer.h" +#include "content/public/browser/notification_registrar.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" + +class WebCursor; +struct ViewHostMsg_UpdateRect_Params; + +namespace gfx { +class Size; +} + +namespace content { +class BrowserPluginGuest; +class RenderViewHost; + +// Helper for browser plugin guest. +// +// 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 lifetime of this class is managed by the associated RenderViewHost. A +// BrowserPluginGuestHelper is created whenever a BrowserPluginGuest is created. +class BrowserPluginGuestHelper : public RenderViewHostObserver { + public: + BrowserPluginGuestHelper(BrowserPluginGuest* guest, + RenderViewHost* render_view_host); + virtual ~BrowserPluginGuestHelper(); + + protected: + // RenderViewHostObserver implementation. + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; + + private: + // Message handlers + void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); + void OnHandleInputEventAck(WebKit::WebInputEvent::Type event_type, + bool processed); + void OnTakeFocus(bool reverse); + void OnShowWidget(int route_id, const gfx::Rect& initial_pos); + void OnSetCursor(const WebCursor& cursor); + + BrowserPluginGuest* guest_; + // A scoped container for notification registries. + NotificationRegistrar registrar_; + + DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuestHelper); +}; + +} // namespace content + +#endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_HELPER_H_ |