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_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_DELEGATE_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 |
(...skipping 15 matching lines...) Expand all Loading... | |
26 // TODO(fsamuel): Remove this. Once guest WebContents allocation | 26 // TODO(fsamuel): Remove this. Once guest WebContents allocation |
27 // moves outside of content, this API will be unnecessary. | 27 // moves outside of content, this API will be unnecessary. |
28 virtual void AddGuest(int guest_instance_id, | 28 virtual void AddGuest(int guest_instance_id, |
29 WebContents* guest_web_contents) {} | 29 WebContents* guest_web_contents) {} |
30 | 30 |
31 // Removes a |guest_instance_id| as a valid guest. | 31 // Removes a |guest_instance_id| as a valid guest. |
32 // TODO(fsamuel): Remove this. Once guest WebContents allocation | 32 // TODO(fsamuel): Remove this. Once guest WebContents allocation |
33 // moves outside of content, this API will be unnecessary. | 33 // moves outside of content, this API will be unnecessary. |
34 virtual void RemoveGuest(int guest_instance_id) {} | 34 virtual void RemoveGuest(int guest_instance_id) {} |
35 | 35 |
36 // Returns a Webcontents given a |guest_instance_id|. Returns NULL if the | 36 typedef base::Callback<void(WebContents*)> GuestByInstanceIDCallback; |
37 // guest wasn't found. If the embedder is not permitted to access the given | 37 virtual void MaybeGetGuestByInstanceIDOrKill( |
lazyboy
2014/05/01 23:27:58
Need description here. Also note when |callback| i
Fady Samuel
2014/05/06 16:51:36
Done.
| |
38 // |guest_instance_id|, the embedder is killed, and NULL is returned. | 38 int guest_instance_id, |
39 virtual WebContents* GetGuestByInstanceID(int guest_instance_id, | |
40 int embedder_render_process_id); | |
41 | |
42 // Returns whether the specified embedder is permitted to access the given | |
43 // |guest_instance_id|. | |
44 // TODO(fsamuel): Remove this. | |
45 virtual bool CanEmbedderAccessInstanceID(int embedder_render_process_id, | |
46 int guest_instance_id); | |
47 | |
48 // Returns whether the specified embedder is permitted to access the given | |
49 // |guest_instance_id|, and kills the embedder if not. | |
50 // TODO(fsamuel): Remove this. | |
51 virtual bool CanEmbedderAccessInstanceIDMaybeKill( | |
52 int embedder_render_process_id, | 39 int embedder_render_process_id, |
53 int guest_instance_id); | 40 const GuestByInstanceIDCallback& callback) {} |
54 | 41 |
55 // Returns an existing SiteInstance if the current profile has a guest of the | 42 // Returns an existing SiteInstance if the current profile has a guest of the |
56 // given |guest_site|. | 43 // given |guest_site|. |
57 // TODO(fsamuel): Remove this. Once guest WebContents allocation | 44 // TODO(fsamuel): Remove this. Once guest WebContents allocation |
58 // moves outside of content, this API will be unnecessary. | 45 // moves outside of content, this API will be unnecessary. |
59 virtual content::SiteInstance* GetGuestSiteInstance(const GURL& guest_site); | 46 virtual content::SiteInstance* GetGuestSiteInstance(const GURL& guest_site); |
60 | 47 |
61 // Iterates over all WebContents belonging to a given |embedder_web_contents|, | 48 // Iterates over all WebContents belonging to a given |embedder_web_contents|, |
62 // calling |callback| for each. If one of the callbacks returns true, then | 49 // calling |callback| for each. If one of the callbacks returns true, then |
63 // the iteration exits early. | 50 // the iteration exits early. |
64 typedef base::Callback<bool(WebContents*)> GuestCallback; | 51 typedef base::Callback<bool(WebContents*)> GuestCallback; |
65 virtual bool ForEachGuest(WebContents* embedder_web_contents, | 52 virtual bool ForEachGuest(WebContents* embedder_web_contents, |
66 const GuestCallback& callback); | 53 const GuestCallback& callback); |
67 }; | 54 }; |
68 | 55 |
69 } // namespace content | 56 } // namespace content |
70 | 57 |
71 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_DELEGATE_H_ | 58 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_DELEGATE_H_ |
OLD | NEW |