Chromium Code Reviews| Index: content/browser/browser_plugin/browser_plugin_host_helper.h |
| diff --git a/content/browser/browser_plugin/browser_plugin_host_helper.h b/content/browser/browser_plugin/browser_plugin_host_helper.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ab543d4d57ace13fcc0873c1d5fdaaf08543df1b |
| --- /dev/null |
| +++ b/content/browser/browser_plugin/browser_plugin_host_helper.h |
| @@ -0,0 +1,76 @@ |
| +// 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_HOST_HELPER_H__ |
| +#define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_HOST_HELPER_H__ |
| + |
| +#include <string> |
| + |
| +#include "base/compiler_specific.h" |
| +#include "content/public/browser/render_view_host_observer.h" |
| +#include "ipc/ipc_channel_handle.h" |
| +#include "ipc/ipc_sync_message.h" |
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| +#include "ui/surface/transport_dib.h" |
| +#include "webkit/glue/webcursor.h" |
| + |
| +namespace gfx { |
| +class Size; |
| +} |
| + |
| +struct BrowserPluginHostMsg_ResizeGuest_Params; |
| +struct ViewHostMsg_UpdateRect_Params; |
| + |
| +namespace content { |
| + |
| +class BrowserPluginHost; |
| + |
| +// This class acts as a plumber helper for BrowserPluginHost. A lot |
|
Charlie Reis
2012/08/13 17:50:14
I'm not entirely clear why this is its own class.
|
| +// of messages coming from guests need to know the guest's RenderViewHost. |
| +// BrowserPluginHostHelper handles BrowserPluginHost messages and relays |
| +// them with their associated RenderViewHosts to BrowserPluginHost where they |
| +// will be handled. |
| +class BrowserPluginHostHelper : public RenderViewHostObserver { |
| + public: |
| + BrowserPluginHostHelper(BrowserPluginHost* browser_plugin_host, |
| + RenderViewHost* render_view_host); |
| + virtual ~BrowserPluginHostHelper(); |
| + |
| + // Make it public for sync IPCs. |
|
Charlie Reis
2012/08/13 17:50:14
Which ones are synchronous?
|
| + virtual bool Send(IPC::Message* message) OVERRIDE; |
| + private: |
| + void OnNavigateOrCreateGuest(int instance_id, |
| + long long frame_id, |
|
Charlie Reis
2012/08/13 17:50:14
nit: Wrong indent.
|
| + const std::string& src, |
| + const gfx::Size& size); |
| + void OnResizeGuest(int instance_id, |
| + const BrowserPluginHostMsg_ResizeGuest_Params& params); |
| + void OnUpdateRectACK(int instance_id, |
| + int message_id, |
| + const gfx::Size& size); |
| + void OnHandleInputEvent(const IPC::SyncMessage& message, bool* handled); |
| + void OnSetFocus(int instance_id, bool focused); |
| + void OnPluginDestroyed(int instance_id); |
| + |
| + // Intercepted from the guest renderer process. |
| + 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); |
| + |
| + // RenderViewHostObserver implementation. |
| + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| + |
| + BrowserPluginHost* browser_plugin_host_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(BrowserPluginHostHelper); |
| +}; |
| + |
| + |
|
Charlie Reis
2012/08/13 17:50:14
nit: Extra space.
|
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_BROWSER_PLUGIN_OLD_BROWSER_PLUGIN_HOST_HELPER_H__ |
| + |