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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest_helper.h

Issue 10868012: Browser Plugin: New Implementation (Browser Side) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master-trial-obrowser
Patch Set: Rename class as we agreed upon, keep correct type of instances (guest/embedder, not helpers) inside… 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/browser_plugin/browser_plugin_guest_helper.h
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 0000000000000000000000000000000000000000..1b1266ba86b43b11dcc9ccf715a93542f2bcac07
--- /dev/null
+++ b/content/browser/browser_plugin/browser_plugin_guest_helper.h
@@ -0,0 +1,65 @@
+// 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 <string>
+
+#include "base/compiler_specific.h"
+#include "content/browser/browser_plugin/browser_plugin_guest.h"
+#include "content/public/browser/render_view_host_observer.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/web_contents_observer.h"
+#include "content/public/browser/notification_registrar.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 RenderViewHost;
+
+// Helper for browser plugin guest.
+// It overrides different WebContents messages that require special treatment
+// for a WebContents to act as a guest. All functionalities are handled by its
+// 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.
+// which can be move to a message filter (IPC thread) for future optimization.
+class BrowserPluginGuestHelper : public RenderViewHostObserver {
+ public:
+ BrowserPluginGuestHelper(BrowserPluginGuest* guest,
+ RenderViewHost* render_view_host);
+ virtual ~BrowserPluginGuestHelper();
+
+ 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);
+
+ // RenderViewHostObserver implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ 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_

Powered by Google App Engine
This is Rietveld 408576698