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