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

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: Merge with ToT 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
« no previous file with comments | « chrome/browser/guest_view/guest_view.h ('k') | chrome/browser/guest_view/guest_view_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..18b7e7d8fb4d0b3756df3a00bec92d05ad3df266 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
@@ -45,10 +43,10 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate {
return NULL;
}
- static GuestViewBase* Create(content::WebContents* guest_web_contents,
+ static GuestViewBase* Create(int guest_instance_id,
+ 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 +88,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 +117,21 @@ 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);
+ GuestViewBase(int guest_instance_id,
+ content::WebContents* guest_web_contents,
+ const std::string& embedder_extension_id);
virtual ~GuestViewBase();
// Dispatches an event |event_name| to the embedder with the |event| fields.
@@ -148,6 +159,14 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate {
// The opener guest view.
base::WeakPtr<GuestViewBase> opener_;
+ DestructionCallback destruction_callback_;
+
+ // The extra parameters associated with this GuestView passed
+ // in from JavaScript. This will typically be the view instance ID,
+ // the API to use, and view-specific parameters. These parameters
+ // are passed along to new guests that are created from this guest.
+ scoped_ptr<base::DictionaryValue> extra_params_;
+
// This is used to ensure pending tasks will not fire after this object is
// destroyed.
base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_;
« no previous file with comments | « chrome/browser/guest_view/guest_view.h ('k') | chrome/browser/guest_view/guest_view_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698