| 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 CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class WebContents; | 22 class WebContents; |
| 23 | 23 |
| 24 // A BrowserPluginGuestManager offloads guest management and routing | 24 // A BrowserPluginGuestManager offloads guest management and routing |
| 25 // operations outside of the content layer. | 25 // operations outside of the content layer. |
| 26 class CONTENT_EXPORT BrowserPluginGuestManager { | 26 class CONTENT_EXPORT BrowserPluginGuestManager { |
| 27 public: | 27 public: |
| 28 virtual ~BrowserPluginGuestManager() {} | 28 virtual ~BrowserPluginGuestManager() {} |
| 29 | 29 |
| 30 typedef base::Callback<void(WebContents*)> GuestByInstanceIDCallback; | 30 typedef base::Callback<void(WebContents*)> GuestByInstanceIDCallback; |
| 31 // Requests a guest WebContents associated with the provided | 31 // Requests a guest WebContents associated with the provided |
| 32 // |guest_instance_id|. If a guest associated with the provided ID | 32 // |browser_plugin_instance_id|. |
| 33 // does not exist, then the |callback| will be called with a NULL | 33 // Returns the guest associated with the provided ID if one exists. |
| 34 // WebContents. If the provided |embedder_render_process_id| does | 34 virtual WebContents* GetGuestByInstanceID(WebContents* embedder_web_contents, |
| 35 // not own the requested guest, then the embedder will be killed, | 35 int browser_plugin_instance_id); |
| 36 // and the |callback| will not be called. | |
| 37 virtual void MaybeGetGuestByInstanceIDOrKill( | |
| 38 WebContents* embedder_web_contents, | |
| 39 int browser_plugin_instance_id, | |
| 40 const GuestByInstanceIDCallback& callback) {} | |
| 41 | 36 |
| 42 // Iterates over all WebContents belonging to a given |embedder_web_contents|, | 37 // Iterates over all WebContents belonging to a given |embedder_web_contents|, |
| 43 // calling |callback| for each. If one of the callbacks returns true, then | 38 // calling |callback| for each. If one of the callbacks returns true, then |
| 44 // the iteration exits early. | 39 // the iteration exits early. |
| 45 typedef base::Callback<bool(WebContents*)> GuestCallback; | 40 typedef base::Callback<bool(WebContents*)> GuestCallback; |
| 46 virtual bool ForEachGuest(WebContents* embedder_web_contents, | 41 virtual bool ForEachGuest(WebContents* embedder_web_contents, |
| 47 const GuestCallback& callback); | 42 const GuestCallback& callback); |
| 48 }; | 43 }; |
| 49 | 44 |
| 50 } // namespace content | 45 } // namespace content |
| 51 | 46 |
| 52 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_H_ | 47 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_H_ |
| OLD | NEW |