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 // | |
35 // It overrides different WebContents messages that require special treatment | |
36 // for a WebContents to act as a guest. All functionality is handled by its | |
37 // delegate. This class exists so we have separation of messages requiring | |
38 // special handling, which can be move to a message filter (IPC thread) for | |
awong
2012/09/09 18:08:09
How likely is this future optimization? If we don'
lazyboy
2012/09/10 16:30:17
This optimization is something we would like to ha
| |
39 // future optimization. | |
40 class BrowserPluginGuestHelper : public RenderViewHostObserver { | |
41 public: | |
42 BrowserPluginGuestHelper(BrowserPluginGuest* guest, | |
43 RenderViewHost* render_view_host); | |
44 virtual ~BrowserPluginGuestHelper(); | |
45 | |
46 private: | |
47 // Message handlers | |
48 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | |
49 void OnHandleInputEventAck(WebKit::WebInputEvent::Type event_type, | |
50 bool processed); | |
51 void OnTakeFocus(bool reverse); | |
52 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); | |
53 void OnSetCursor(const WebCursor& cursor); | |
54 | |
55 // RenderViewHostObserver implementation. | |
56 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
awong
2012/09/09 18:08:09
Please go through all the classes and move overrid
lazyboy
2012/09/10 16:30:17
Fixed.
| |
57 | |
58 BrowserPluginGuest* guest_; | |
59 // A scoped container for notification registries. | |
60 NotificationRegistrar registrar_; | |
61 | |
62 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuestHelper); | |
63 }; | |
64 | |
65 } // namespace content | |
66 | |
67 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_HELPER_H_ | |
OLD | NEW |