Chromium Code Reviews| 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 3fe02f404a0aaa9240ac58b98bb3351bf8fbee6c..4db930efa2f7d2fccfa6121194ba97df162203dc 100644 |
| --- a/chrome/browser/guest_view/guest_view_base.h |
| +++ b/chrome/browser/guest_view/guest_view_base.h |
| @@ -12,8 +12,6 @@ |
| #include "content/public/browser/browser_plugin_guest_delegate.h" |
| #include "content/public/browser/web_contents.h" |
| -class AdViewGuest; |
| -class WebViewGuest; |
| struct RendererContentSettingRules; |
| // A GuestViewBase is the base class browser-side API implementation for a |
| @@ -47,8 +45,7 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate { |
| static GuestViewBase* Create(content::WebContents* guest_web_contents, |
| const std::string& embedder_extension_id, |
| - const std::string& view_type, |
| - const base::WeakPtr<GuestViewBase>& opener); |
| + const std::string& view_type); |
| static GuestViewBase* FromWebContents(content::WebContents* web_contents); |
| @@ -90,6 +87,12 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate { |
| return guest_web_contents_; |
| } |
| + // Returns the extra parameters associated with this GuestView passed |
| + // in from JavaScript. |
| + base::DictionaryValue* extra_params() const { |
| + return extra_params_.get(); |
| + } |
| + |
| // Returns whether this guest has an associated embedder. |
| bool attached() const { return !!embedder_web_contents_; } |
| @@ -113,14 +116,20 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate { |
| // Returns the embedder's process ID. |
| int embedder_render_process_id() const { return embedder_render_process_id_; } |
| + GuestViewBase* GetOpener() const { |
| + return opener_.get(); |
| + } |
| + |
| + void SetOpener(GuestViewBase* opener); |
| + |
| // BrowserPluginGuestDelegate implementation. |
| - virtual content::WebContents* GetOpener() const OVERRIDE; |
| - virtual void SetOpener(content::WebContents* opener) OVERRIDE; |
| + virtual void Destroy() OVERRIDE; |
| + virtual void RegisterDestructionCallback( |
| + const DestructionCallback& callback) OVERRIDE; |
| protected: |
| GuestViewBase(content::WebContents* guest_web_contents, |
| - const std::string& embedder_extension_id, |
| - const base::WeakPtr<GuestViewBase>& opener); |
| + const std::string& embedder_extension_id); |
| virtual ~GuestViewBase(); |
| // Dispatches an event |event_name| to the embedder with the |event| fields. |
| @@ -148,6 +157,10 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate { |
| // The opener guest view. |
| base::WeakPtr<GuestViewBase> opener_; |
| + DestructionCallback destruction_callback_; |
| + |
| + scoped_ptr<base::DictionaryValue> extra_params_; |
|
lazyboy
2014/05/12 23:00:20
A bit of desc + a typical example of what this dic
Fady Samuel
2014/05/13 18:59:02
Done.
|
| + |
| // This is used to ensure pending tasks will not fire after this object is |
| // destroyed. |
| base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |