Index: chrome/browser/guest_view/guest_view_manager.h |
diff --git a/chrome/browser/guest_view/guest_view_manager.h b/chrome/browser/guest_view/guest_view_manager.h |
index 8b32ed9c41be297e66bc2ca605f62c4bcbede80d..a06a6945bb8330c2709770e729c536706eb1c44a 100644 |
--- a/chrome/browser/guest_view/guest_view_manager.h |
+++ b/chrome/browser/guest_view/guest_view_manager.h |
@@ -45,6 +45,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*)> |
@@ -71,6 +80,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; |
@@ -104,6 +116,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 |