Index: extensions/browser/guest_view/guest_view_manager.h |
diff --git a/extensions/browser/guest_view/guest_view_manager.h b/extensions/browser/guest_view/guest_view_manager.h |
index 44f4249a9babddf371474e1cbdf76236ad21d7bf..cf4b83f49f27052cf217111588f97772a773bbf3 100644 |
--- a/extensions/browser/guest_view/guest_view_manager.h |
+++ b/extensions/browser/guest_view/guest_view_manager.h |
@@ -47,6 +47,15 @@ class GuestViewManager : public content::BrowserPluginGuestManager, |
int guest_instance_id, |
int embedder_render_process_id); |
+ // Associates the Browser Plugin with |element_instance_id| to a |
+ // guest that has ID of |guest_instance_id| and sets initialization |
+ // parameters, |params| for it. |
+ void SetAttachParamsForGuest(int embedder_render_process_id, |
+ int embedder_routing_id, |
+ int element_instance_id, |
+ int guest_instance_id, |
+ const base::DictionaryValue& params); |
+ |
int GetNextInstanceID(); |
typedef base::Callback<void(content::WebContents*)> |
@@ -73,6 +82,9 @@ class GuestViewManager : public content::BrowserPluginGuestManager, |
const GuestByInstanceIDCallback& callback) OVERRIDE; |
virtual bool ForEachGuest(content::WebContents* embedder_web_contents, |
const GuestCallback& callback) OVERRIDE; |
+ virtual int GetGuestInstanceIDForPluginID( |
+ content::WebContents* embedder_web_contents, |
+ int element_instance_id) OVERRIDE; |
protected: |
friend class GuestViewBase; |
@@ -106,6 +118,26 @@ class GuestViewManager : public content::BrowserPluginGuestManager, |
typedef std::map<int, content::WebContents*> GuestInstanceMap; |
GuestInstanceMap guest_web_contents_by_instance_id_; |
+ struct ElementInstanceKey { |
+ content::WebContents* embedder_web_contents; |
+ int element_instance_id; |
+ ElementInstanceKey(content::WebContents* embedder_web_contents, |
+ int element_instance_id) |
+ : embedder_web_contents(embedder_web_contents), |
+ element_instance_id(element_instance_id) {} |
+ bool operator<(const ElementInstanceKey& other) const { |
+ if (embedder_web_contents != other.embedder_web_contents) |
+ return embedder_web_contents < other.embedder_web_contents; |
+ return element_instance_id < other.element_instance_id; |
+ } |
+ }; |
+ |
+ typedef std::map<ElementInstanceKey, int> GuestInstanceIDMap; |
+ GuestInstanceIDMap instance_id_map_; |
+ // The reverse map of GuestInstanceIDMap. |
+ typedef std::map<int, ElementInstanceKey> GuestInstanceIDReverseMap; |
+ GuestInstanceIDReverseMap reverse_instance_id_map_; |
+ |
int current_instance_id_; |
// Any instance ID whose number not greater than this was removed via |