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 21 matching lines...) Expand all Loading... |
32 // |guest_instance_id|. If a guest associated with the provided ID | 32 // |guest_instance_id|. If a guest associated with the provided ID |
33 // does not exist, then the |callback| will be called with a NULL | 33 // does not exist, then the |callback| will be called with a NULL |
34 // WebContents. If the provided |embedder_render_process_id| does | 34 // WebContents. If the provided |embedder_render_process_id| does |
35 // not own the requested guest, then the embedder will be killed, | 35 // not own the requested guest, then the embedder will be killed, |
36 // and the |callback| will not be called. | 36 // and the |callback| will not be called. |
37 virtual void MaybeGetGuestByInstanceIDOrKill( | 37 virtual void MaybeGetGuestByInstanceIDOrKill( |
38 int guest_instance_id, | 38 int guest_instance_id, |
39 int embedder_render_process_id, | 39 int embedder_render_process_id, |
40 const GuestByInstanceIDCallback& callback) {} | 40 const GuestByInstanceIDCallback& callback) {} |
41 | 41 |
| 42 // Translates a content/ generated instance ID to chrome/ instance ID for a |
| 43 // Browser Plugin. |
| 44 // TODO(lazyboy): This is temporary, once we have clear separation of |
| 45 // content/ vs chrome/ IDs, remove this. |
| 46 virtual int GetGuestInstanceIDForPluginID(WebContents* embedder_web_contents, |
| 47 int element_instance_id); |
| 48 |
42 // Iterates over all WebContents belonging to a given |embedder_web_contents|, | 49 // Iterates over all WebContents belonging to a given |embedder_web_contents|, |
43 // calling |callback| for each. If one of the callbacks returns true, then | 50 // calling |callback| for each. If one of the callbacks returns true, then |
44 // the iteration exits early. | 51 // the iteration exits early. |
45 typedef base::Callback<bool(WebContents*)> GuestCallback; | 52 typedef base::Callback<bool(WebContents*)> GuestCallback; |
46 virtual bool ForEachGuest(WebContents* embedder_web_contents, | 53 virtual bool ForEachGuest(WebContents* embedder_web_contents, |
47 const GuestCallback& callback); | 54 const GuestCallback& callback); |
48 }; | 55 }; |
49 | 56 |
50 } // namespace content | 57 } // namespace content |
51 | 58 |
52 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_H_ | 59 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_H_ |
OLD | NEW |