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