| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_ |
| 6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_ | 6 #define CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "content/public/browser/browser_plugin_guest_manager_delegate.h" | 12 #include "content/public/browser/browser_plugin_guest_manager.h" |
| 13 #include "content/public/browser/site_instance.h" | 13 #include "content/public/browser/site_instance.h" |
| 14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 15 | 15 |
| 16 class GuestViewBase; | 16 class GuestViewBase; |
| 17 class GuestWebContentsObserver; | 17 class GuestWebContentsObserver; |
| 18 class GURL; | 18 class GURL; |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 class BrowserContext; | 21 class BrowserContext; |
| 22 } // namespace content | 22 } // namespace content |
| 23 | 23 |
| 24 class GuestViewManager : public content::BrowserPluginGuestManagerDelegate, | 24 class GuestViewManager : public content::BrowserPluginGuestManager, |
| 25 public base::SupportsUserData::Data { | 25 public base::SupportsUserData::Data { |
| 26 public: | 26 public: |
| 27 explicit GuestViewManager(content::BrowserContext* context); | 27 explicit GuestViewManager(content::BrowserContext* context); |
| 28 virtual ~GuestViewManager(); | 28 virtual ~GuestViewManager(); |
| 29 | 29 |
| 30 static GuestViewManager* FromBrowserContext(content::BrowserContext* context); | 30 static GuestViewManager* FromBrowserContext(content::BrowserContext* context); |
| 31 | 31 |
| 32 void AddGuest(int guest_instance_id, | 32 void AddGuest(int guest_instance_id, |
| 33 content::WebContents* guest_web_contents); | 33 content::WebContents* guest_web_contents); |
| 34 void RemoveGuest(int guest_instance_id); | 34 void RemoveGuest(int guest_instance_id); |
| 35 | 35 |
| 36 content::WebContents* GetGuestByInstanceIDSafely( | 36 content::WebContents* GetGuestByInstanceIDSafely( |
| 37 int guest_instance_id, | 37 int guest_instance_id, |
| 38 int embedder_render_process_id); | 38 int embedder_render_process_id); |
| 39 bool CanEmbedderAccessInstanceIDMaybeKill( | 39 bool CanEmbedderAccessInstanceIDMaybeKill( |
| 40 int embedder_render_process_id, | 40 int embedder_render_process_id, |
| 41 int guest_instance_id); | 41 int guest_instance_id); |
| 42 bool CanEmbedderAccessInstanceID(int embedder_render_process_id, | 42 bool CanEmbedderAccessInstanceID(int embedder_render_process_id, |
| 43 int guest_instance_id); | 43 int guest_instance_id); |
| 44 | 44 |
| 45 // BrowserPluginGuestManagerDelegate implementation. | 45 // BrowserPluginGuestManager implementation. |
| 46 virtual content::WebContents* CreateGuest( | 46 virtual content::WebContents* CreateGuest( |
| 47 content::SiteInstance* embedder_site_instance, | 47 content::SiteInstance* embedder_site_instance, |
| 48 int instance_id, | 48 int instance_id, |
| 49 const content::StorageInfo& storage_info, | 49 const content::StorageInfo& storage_info, |
| 50 scoped_ptr<base::DictionaryValue> extra_params) OVERRIDE; | 50 scoped_ptr<base::DictionaryValue> extra_params) OVERRIDE; |
| 51 virtual int GetNextInstanceID() OVERRIDE; | 51 virtual int GetNextInstanceID() OVERRIDE; |
| 52 virtual void MaybeGetGuestByInstanceIDOrKill( | 52 virtual void MaybeGetGuestByInstanceIDOrKill( |
| 53 int guest_instance_id, | 53 int guest_instance_id, |
| 54 int embedder_render_process_id, | 54 int embedder_render_process_id, |
| 55 const GuestByInstanceIDCallback& callback) OVERRIDE; | 55 const GuestByInstanceIDCallback& callback) OVERRIDE; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 78 typedef std::map<int, content::WebContents*> GuestInstanceMap; | 78 typedef std::map<int, content::WebContents*> GuestInstanceMap; |
| 79 GuestInstanceMap guest_web_contents_by_instance_id_; | 79 GuestInstanceMap guest_web_contents_by_instance_id_; |
| 80 | 80 |
| 81 int current_instance_id_; | 81 int current_instance_id_; |
| 82 content::BrowserContext* context_; | 82 content::BrowserContext* context_; |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(GuestViewManager); | 84 DISALLOW_COPY_AND_ASSIGN(GuestViewManager); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_ | 87 #endif // CHROME_BROWSER_GUEST_VIEW_GUEST_VIEW_MANAGER_H_ |
| OLD | NEW |