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

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: 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
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..1cb9eb0912d46eee1a68782a75dbbb9846795eb5 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,11 +40,20 @@ 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_;
+ bool attached_;
+ bool attach_pending_;
+
+ ScopedPersistent<v8::Function> callback_;
+ v8::Isolate* isolate_;
lazyboy 2014/09/17 18:24:00 What about the lifetime of this? I don't know much
Fady Samuel 2014/09/17 20:25:46 Acknowledged.
+
DISALLOW_COPY_AND_ASSIGN(GuestViewContainer);
};

Powered by Google App Engine
This is Rietveld 408576698