Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_HELPER_H_ | |
| 6 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_HELPER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "content/browser/browser_plugin/browser_plugin_guest.h" | |
| 12 #include "content/public/browser/render_view_host_observer.h" | |
| 13 #include "content/public/browser/notification_observer.h" | |
| 14 #include "content/public/browser/web_contents_observer.h" | |
| 15 #include "content/public/browser/notification_registrar.h" | |
| 16 #include "ipc/ipc_channel_handle.h" | |
| 17 #include "ipc/ipc_sync_message.h" | |
| 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | |
| 19 #include "ui/surface/transport_dib.h" | |
| 20 #include "webkit/glue/webcursor.h" | |
| 21 | |
| 22 namespace gfx { | |
| 23 class Size; | |
| 24 } | |
| 25 | |
| 26 struct BrowserPluginHostMsg_ResizeGuest_Params; | |
| 27 struct ViewHostMsg_UpdateRect_Params; | |
| 28 | |
| 29 namespace content { | |
| 30 | |
| 31 class RenderViewHost; | |
| 32 | |
| 33 // Helper for browser plugin guest. | |
| 34 // It overrides different WebContents messages that require special treatment | |
| 35 // for a WebContents to act as a guest. All functionalities are handled by its | |
| 36 // delegate, this class exists so we have separation of messages it handles, | |
|
Charlie Reis
2012/08/27 20:23:59
nit: delegate. This class
(or use a semicolon)
lazyboy
2012/08/28 19:07:14
Done.
| |
| 37 // which can be move to a message filter (IPC thread) for future optimization. | |
| 38 class BrowserPluginGuestHelper : public RenderViewHostObserver { | |
| 39 public: | |
| 40 BrowserPluginGuestHelper(BrowserPluginGuest* guest, | |
| 41 RenderViewHost* render_view_host); | |
| 42 virtual ~BrowserPluginGuestHelper(); | |
| 43 | |
| 44 private: | |
| 45 // Message handlers | |
| 46 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | |
| 47 void OnHandleInputEventAck(WebKit::WebInputEvent::Type event_type, | |
| 48 bool processed); | |
| 49 void OnTakeFocus(bool reverse); | |
| 50 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); | |
| 51 void OnSetCursor(const WebCursor& cursor); | |
| 52 | |
| 53 // RenderViewHostObserver implementation. | |
| 54 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
| 55 | |
| 56 BrowserPluginGuest* guest_; | |
| 57 // A scoped container for notification registries. | |
| 58 NotificationRegistrar registrar_; | |
| 59 | |
| 60 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuestHelper); | |
| 61 }; | |
| 62 | |
| 63 } // namespace content | |
| 64 | |
| 65 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_HELPER_H_ | |
| OLD | NEW |