Chromium Code Reviews| Index: content/public/browser/browser_plugin_guest_manager_delegate.h |
| diff --git a/content/public/browser/browser_plugin_guest_manager_delegate.h b/content/public/browser/browser_plugin_guest_manager_delegate.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..34f3c5aef75cb6f0899a1116205bf80ac9f27683 |
| --- /dev/null |
| +++ b/content/public/browser/browser_plugin_guest_manager_delegate.h |
| @@ -0,0 +1,65 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_DELEGATE_H_ |
| +#define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_DELEGATE_H_ |
| + |
| +#include "base/callback.h" |
| +#include "build/build_config.h" |
|
lazyboy
2014/05/01 20:06:59
Why do you need this? I don't see any OS_* ifdef i
Fady Samuel
2014/05/01 21:05:28
Done.
|
| +#include "content/common/content_export.h" |
| + |
| +class GURL; |
| + |
| +namespace content { |
| + |
| +class SiteInstance; |
| +class WebContents; |
| + |
| +class CONTENT_EXPORT BrowserPluginGuestManagerDelegate { |
| + public: |
| + virtual ~BrowserPluginGuestManagerDelegate() {} |
| + |
| + // Return a new instance ID. |
| + virtual int GetNextInstanceID(); |
| + |
| + // TODO(fsamuel): Remove this. |
| + virtual void AddGuest(int guest_instance_id, |
| + WebContents* guest_web_contents) {} |
| + |
| + // TODO(fsamuel): Remove this. |
| + virtual void RemoveGuest(int guest_instance_id) {} |
| + |
| + // Returns a Webcontents given a |guest_instance_id|. Returns NULL if the |
| + // guest wasn't found. If the embedder is not permitted to access the given |
| + // |guest_instance_id|, the embedder is killed, and NULL is returned. |
| + virtual WebContents* GetGuestByInstanceID(int guest_instance_id, |
| + int embedder_render_process_id); |
| + |
| + // Returns whether the specified embedder is permitted to access the given |
| + // |guest_instance_id|. |
| + // TODO(fsamuel): Remove this. |
| + virtual bool CanEmbedderAccessInstanceID(int embedder_render_process_id, |
| + int guest_instance_id); |
| + |
| + // Returns whether the specified embedder is permitted to access the given |
| + // |guest_instance_id|, and kills the embedder if not. |
| + // TODO(fsamuel): Remove this. |
| + virtual bool CanEmbedderAccessInstanceIDMaybeKill( |
| + int embedder_render_process_id, |
| + int guest_instance_id); |
| + |
| + // TODO(fsamuel): Remove this. |
| + virtual content::SiteInstance* GetGuestSiteInstance(const GURL& guest_site); |
| + |
| + // Iterates over all WebContents belonging to a given |embedder_web_contents|, |
| + // calling |callback| for each. If one of the callbacks returns true, then |
| + // the iteration exits early. |
| + typedef base::Callback<bool(WebContents*)> GuestCallback; |
| + virtual bool ForEachGuest(WebContents* embedder_web_contents, |
| + const GuestCallback& callback); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_DELEGATE_H_ |