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 "base/callback.h" | 8 #include "base/callback.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 class WebContents; | 13 class WebContents; |
14 | 14 |
15 // A BrowserPluginGuestManager offloads guest management and routing | 15 // A BrowserPluginGuestManager offloads guest management and routing |
16 // operations outside of the content layer. | 16 // operations outside of the content layer. |
17 class CONTENT_EXPORT BrowserPluginGuestManager { | 17 class CONTENT_EXPORT BrowserPluginGuestManager { |
18 public: | 18 public: |
19 virtual ~BrowserPluginGuestManager() {} | 19 virtual ~BrowserPluginGuestManager() {} |
20 | 20 |
21 // Requests a guest WebContents associated with the provided | 21 // Requests a guest WebContents associated with the provided |
22 // |browser_plugin_instance_id|. | 22 // <owner_process_id, browser_plugin_instance_id> tuple. |
23 // Returns the guest associated with the provided ID if one exists. | 23 virtual WebContents* GetGuestByInstanceID(int owner_process_id, |
24 virtual WebContents* GetGuestByInstanceID(WebContents* embedder_web_contents, | |
25 int browser_plugin_instance_id); | 24 int browser_plugin_instance_id); |
26 | 25 |
27 // Iterates over all WebContents belonging to a given |embedder_web_contents|, | 26 // Iterates over all WebContents belonging to a given |embedder_web_contents|, |
28 // calling |callback| for each. If one of the callbacks returns true, then | 27 // calling |callback| for each. If one of the callbacks returns true, then |
29 // the iteration exits early. | 28 // the iteration exits early. |
30 typedef base::Callback<bool(WebContents*)> GuestCallback; | 29 typedef base::Callback<bool(WebContents*)> GuestCallback; |
31 virtual bool ForEachGuest(WebContents* embedder_web_contents, | 30 virtual bool ForEachGuest(WebContents* embedder_web_contents, |
32 const GuestCallback& callback); | 31 const GuestCallback& callback); |
33 }; | 32 }; |
34 | 33 |
35 } // namespace content | 34 } // namespace content |
36 | 35 |
37 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_H_ | 36 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_H_ |
OLD | NEW |