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

Unified Diff: extensions/renderer/guest_view/guest_view_container.h

Issue 564973004: Move ContentWindow from BrowserPlugin To GuestView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More cleanup Created 6 years, 3 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
« no previous file with comments | « extensions/common/extension_messages.h ('k') | extensions/renderer/guest_view/guest_view_container.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « extensions/common/extension_messages.h ('k') | extensions/renderer/guest_view/guest_view_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698