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

Unified Diff: chrome/browser/guest_view/guest_view_base.h

Issue 272573005: <webview>: Move NewWindow API to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@guestview_manager_rename
Patch Set: Cleanup and fix tests Created 6 years, 7 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: 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_;

Powered by Google App Engine
This is Rietveld 408576698