Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: content/browser/browser_plugin/browser_plugin_host_helper.h

Issue 10735010: 3D Compositing in <browser>, first draft. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Use the correct baseline Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_HOST_HELPER_H__ 5 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_HOST_HELPER_H__
6 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_HOST_HELPER_H__ 6 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_HOST_HELPER_H__
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "content/common/browser_plugin_info.h"
11 #include "content/public/browser/render_view_host_observer.h" 12 #include "content/public/browser/render_view_host_observer.h"
12 #include "ipc/ipc_channel_handle.h" 13 #include "ipc/ipc_channel_handle.h"
13 #include "ipc/ipc_sync_message.h" 14 #include "ipc/ipc_sync_message.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
15 #include "ui/surface/transport_dib.h" 16 #include "ui/surface/transport_dib.h"
16 #include "webkit/glue/webcursor.h" 17 #include "webkit/glue/webcursor.h"
17 18
18 namespace gfx { 19 namespace gfx {
19 class Size; 20 class Size;
20 } 21 }
21 22
23 struct BrowserPlugin_SwapInfo;
22 struct BrowserPluginHostMsg_ResizeGuest_Params; 24 struct BrowserPluginHostMsg_ResizeGuest_Params;
23 struct ViewHostMsg_UpdateRect_Params; 25 struct ViewHostMsg_UpdateRect_Params;
24 26
25 namespace content { 27 namespace content {
26 28
27 class BrowserPluginHost; 29 class BrowserPluginHost;
28 30
29 // This class acts as a plumber helper for BrowserPluginHost. A lot 31 // This class acts as a plumber helper for BrowserPluginHost. A lot
30 // of messages coming from guests need to know the guest's RenderViewHost. 32 // of messages coming from guests need to know the guest's RenderViewHost.
31 // BrowserPluginHostHelper handles BrowserPluginHost messages and relays 33 // BrowserPluginHostHelper handles BrowserPluginHost messages and relays
32 // them with their associated RenderViewHosts to BrowserPluginHost where they 34 // them with their associated RenderViewHosts to BrowserPluginHost where they
33 // will be handled. 35 // will be handled.
34 class BrowserPluginHostHelper : public RenderViewHostObserver { 36 class BrowserPluginHostHelper : public RenderViewHostObserver {
35 public: 37 public:
36 BrowserPluginHostHelper(BrowserPluginHost* browser_plugin_host, 38 BrowserPluginHostHelper(BrowserPluginHost* browser_plugin_host,
37 RenderViewHost* render_view_host); 39 RenderViewHost* render_view_host,
40 const BrowserPluginHostMsg_Surface_Params& params);
38 virtual ~BrowserPluginHostHelper(); 41 virtual ~BrowserPluginHostHelper();
39 42
40 // Make it public for sync IPCs. 43 // Make it public for sync IPCs.
41 virtual bool Send(IPC::Message* message) OVERRIDE; 44 virtual bool Send(IPC::Message* message) OVERRIDE;
42 private: 45 private:
43 void OnNavigateGuest(int instance_id, 46 void OnNavigateGuest(int instance_id,
44 long long frame_id, 47 long long frame_id,
45 const std::string& src, 48 const std::string& src,
46 const gfx::Size& size); 49 const gfx::Size& size,
50 const BrowserPluginHostMsg_Surface_Params& params);
51 void OnSwapBuffersACK(const BrowserPlugin_SwapInfo& info, uint32 sync_point);
47 void OnResizeGuest(int instance_id, 52 void OnResizeGuest(int instance_id,
48 const BrowserPluginHostMsg_ResizeGuest_Params& params); 53 const BrowserPluginHostMsg_ResizeGuest_Params& params);
49 void OnUpdateRectACK(int instance_id, 54 void OnUpdateRectACK(int instance_id,
50 int message_id, 55 int message_id,
51 const gfx::Size& size); 56 const gfx::Size& size);
52 void OnHandleInputEvent(const IPC::SyncMessage& message, bool* handled); 57 void OnHandleInputEvent(const IPC::SyncMessage& message, bool* handled);
53 void OnSetFocus(int instance_id, bool focused); 58 void OnSetFocus(int instance_id, bool focused);
54 void OnPluginDestroyed(int instance_id); 59 void OnPluginDestroyed(int instance_id);
55 60
56 // Intercepted from the guest renderer process. 61 // Intercepted from the guest renderer process.
57 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); 62 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params);
58 void OnHandleInputEventAck(WebKit::WebInputEvent::Type event_type, 63 void OnHandleInputEventAck(WebKit::WebInputEvent::Type event_type,
59 bool processed); 64 bool processed);
60 void OnTakeFocus(bool reverse); 65 void OnTakeFocus(bool reverse);
61 void OnShowWidget(int route_id, const gfx::Rect& initial_pos); 66 void OnShowWidget(int route_id, const gfx::Rect& initial_pos);
62 void OnSetCursor(const WebCursor& cursor); 67 void OnSetCursor(const WebCursor& cursor);
63 68
64 // RenderViewHostObserver implementation. 69 // RenderViewHostObserver implementation.
65 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 70 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
66 71
67 BrowserPluginHost* browser_plugin_host_; 72 BrowserPluginHost* browser_plugin_host_;
68 73
74 BrowserPluginHostMsg_Surface_Params surface_params_;
75
76 friend class BrowserPluginCompositingDelegate;
77
69 DISALLOW_COPY_AND_ASSIGN(BrowserPluginHostHelper); 78 DISALLOW_COPY_AND_ASSIGN(BrowserPluginHostHelper);
70 }; 79 };
71 80
72 81
73 } // namespace content 82 } // namespace content
74 83
75 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_OLD_BROWSER_PLUGIN_HOST_HELPER_H__ 84 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_OLD_BROWSER_PLUGIN_HOST_HELPER_H__
76 85
OLDNEW
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_host.cc ('k') | content/browser/browser_plugin/browser_plugin_host_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698