OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_DELEGATE_H_ | |
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_DELEGATE_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "content/common/content_export.h" | |
10 | |
11 class GURL; | |
12 | |
13 namespace base { | |
14 class DictionaryValue; | |
15 } // namespace base | |
16 | |
17 namespace content { | |
18 | |
19 class SiteInstance; | |
20 class WebContents; | |
21 | |
22 // A BrowserPluginGuestManagerDelegate offloads guest management and routing | |
23 // operations outside of the content layer. | |
24 struct StorageInfo { | |
25 bool persist; | |
26 std::string partition_id; | |
27 }; | |
28 | |
29 class CONTENT_EXPORT BrowserPluginGuestManagerDelegate { | |
30 public: | |
31 virtual ~BrowserPluginGuestManagerDelegate() {} | |
32 | |
33 virtual content::WebContents* CreateGuest( | |
34 content::SiteInstance* embedder_site_instance, | |
35 int instance_id, | |
36 const StorageInfo& storage_info, | |
37 scoped_ptr<base::DictionaryValue> extra_params); | |
38 | |
39 // Return a new instance ID. | |
40 // TODO(fsamuel): Remove this. Once the instance ID concept is moved | |
41 // entirely out of content and into chrome, this API will be unnecessary. | |
42 virtual int GetNextInstanceID(); | |
43 | |
44 typedef base::Callback<void(WebContents*)> GuestByInstanceIDCallback; | |
45 virtual void MaybeGetGuestByInstanceIDOrKill( | |
46 int guest_instance_id, | |
47 int embedder_render_process_id, | |
48 const GuestByInstanceIDCallback& callback) {} | |
49 | |
50 // Iterates over all WebContents belonging to a given |embedder_web_contents|, | |
51 // calling |callback| for each. If one of the callbacks returns true, then | |
52 // the iteration exits early. | |
53 typedef base::Callback<bool(WebContents*)> GuestCallback; | |
54 virtual bool ForEachGuest(WebContents* embedder_web_contents, | |
55 const GuestCallback& callback); | |
56 }; | |
57 | |
58 } // namespace content | |
59 | |
60 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_DELEGATE_H_ | |
OLD | NEW |