Index: extensions/renderer/guest_view/guest_view_container.h |
diff --git a/extensions/renderer/guest_view/guest_view_container.h b/extensions/renderer/guest_view/guest_view_container.h |
index 68db47fe21cd5639e52cca531fee57270dabef71..004810f118bdb844f4c5f66bf1d9883c951c8db4 100644 |
--- a/extensions/renderer/guest_view/guest_view_container.h |
+++ b/extensions/renderer/guest_view/guest_view_container.h |
@@ -5,14 +5,14 @@ |
#ifndef CHROME_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_ |
#define CHROME_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_ |
+#include "base/memory/scoped_ptr.h" |
+#include "base/values.h" |
#include "content/public/renderer/browser_plugin_delegate.h" |
- |
#include "content/public/renderer/render_frame_observer.h" |
-#include "ipc/ipc_listener.h" |
+#include "extensions/renderer/scoped_persistent.h" |
namespace extensions { |
-// TODO(lazyboy): This should live under /extensions. |
class GuestViewContainer : public content::BrowserPluginDelegate, |
public content::RenderFrameObserver { |
public: |
@@ -20,6 +20,15 @@ class GuestViewContainer : public content::BrowserPluginDelegate, |
const std::string& mime_type); |
virtual ~GuestViewContainer(); |
+ static GuestViewContainer* FromID(int render_view_routing_id, |
+ int element_instance_id); |
+ |
+ void AttachGuest(int element_instance_id, |
+ int guest_instance_id, |
+ scoped_ptr<base::DictionaryValue> params, |
+ v8::Handle<v8::Function> callback, |
+ v8::Isolate* isolate); |
+ |
// BrowserPluginDelegate implementation. |
virtual void SetElementInstanceID(int element_instance_id) OVERRIDE; |
virtual void DidFinishLoading() OVERRIDE; |
@@ -31,10 +40,22 @@ class GuestViewContainer : public content::BrowserPluginDelegate, |
private: |
void OnCreateMimeHandlerViewGuestACK(int element_instance_id); |
+ void OnGuestAttached(int element_instance_id, int guest_routing_id); |
+ |
+ static bool ShouldHandleMessage(const IPC::Message& mesage); |
const std::string mime_type_; |
int element_instance_id_; |
std::string html_string_; |
+ // Save the RenderView RoutingID here so that we can use it during |
+ // destruction. |
+ int render_view_routing_id_; |
+ |
+ bool attached_; |
+ bool attach_pending_; |
+ |
+ ScopedPersistent<v8::Function> callback_; |
+ v8::Isolate* isolate_; |
DISALLOW_COPY_AND_ASSIGN(GuestViewContainer); |
}; |