| Index: chrome/browser/guest_view/guest_view_base.h
|
| diff --git a/chrome/browser/guest_view/guest_view_base.h b/chrome/browser/guest_view/guest_view_base.h
|
| index 95c19e1d32482b9a157988b76f8118be29cafbc2..a67623830a84bc66f97d00a47a2c4cd240d07c6b 100644
|
| --- a/chrome/browser/guest_view/guest_view_base.h
|
| +++ b/chrome/browser/guest_view/guest_view_base.h
|
| @@ -64,6 +64,12 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate,
|
|
|
| virtual const char* GetViewType() const = 0;
|
|
|
| + // This method is called after the guest has been attached to an embedder.
|
| + //
|
| + // This method can be overriden by subclasses. This gives the derived class
|
| + // an opportunity to perform setup actions after attachment.
|
| + virtual void DidAttach() {}
|
| +
|
| // This method can be overridden by subclasses. This method is called when
|
| // the initial set of frames within the page have completed loading.
|
| virtual void DidStopLoading() {}
|
| @@ -93,15 +99,15 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate,
|
| // this behavior to enable drag-and-drop.
|
| virtual bool IsDragAndDropEnabled() const;
|
|
|
| + void Init(content::WebContents* guest_web_contents,
|
| + const std::string& embedder_extension_id);
|
| +
|
| bool IsViewType(const char* const view_type) const {
|
| return !strcmp(GetViewType(), view_type);
|
| }
|
|
|
| base::WeakPtr<GuestViewBase> AsWeakPtr();
|
|
|
| - virtual void Attach(content::WebContents* embedder_web_contents,
|
| - const base::DictionaryValue& args);
|
| -
|
| content::WebContents* embedder_web_contents() const {
|
| return embedder_web_contents_;
|
| }
|
| @@ -148,13 +154,15 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate,
|
|
|
| // BrowserPluginGuestDelegate implementation.
|
| virtual void Destroy() OVERRIDE FINAL;
|
| + virtual void DidAttach(
|
| + content::WebContents* embedder_web_contents,
|
| + const base::DictionaryValue& extra_params) OVERRIDE FINAL;
|
| virtual void RegisterDestructionCallback(
|
| const DestructionCallback& callback) OVERRIDE FINAL;
|
|
|
| protected:
|
| - GuestViewBase(int guest_instance_id,
|
| - content::WebContents* guest_web_contents,
|
| - const std::string& embedder_extension_id);
|
| + explicit GuestViewBase(int guest_instance_id);
|
| +
|
| virtual ~GuestViewBase();
|
|
|
| // Dispatches an event |event_name| to the embedder with the |event| fields.
|
| @@ -177,9 +185,9 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate,
|
| const blink::WebGestureEvent& event) OVERRIDE FINAL;
|
|
|
| content::WebContents* embedder_web_contents_;
|
| - const std::string embedder_extension_id_;
|
| + std::string embedder_extension_id_;
|
| int embedder_render_process_id_;
|
| - content::BrowserContext* const browser_context_;
|
| + content::BrowserContext* browser_context_;
|
| // |guest_instance_id_| is a profile-wide unique identifier for a guest
|
| // WebContents.
|
| const int guest_instance_id_;
|
| @@ -187,6 +195,8 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate,
|
| // embedder RenderViewHost for a particular <*view> instance.
|
| int view_instance_id_;
|
|
|
| + bool initialized_;
|
| +
|
| // This is a queue of Events that are destined to be sent to the embedder once
|
| // the guest is attached to a particular embedder.
|
| std::deque<linked_ptr<Event> > pending_events_;
|
|
|