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..76ff007e9761864d0964f77c40c796a515ac9815 |
| --- /dev/null |
| +++ b/content/public/browser/browser_plugin_guest_manager_delegate.h |
| @@ -0,0 +1,72 @@ |
| +// 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" |
| +#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. |
|
lazyboy
2014/05/01 20:06:59
A bit of description why this is temporary?
Fady Samuel
2014/05/01 21:05:28
Done.
|
| + 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); |
| + |
| + // Requests an instance ID for the given |src| URL. If the operation completes |
| + // succcessfully, then callback is called with the instance ID. |
|
lazyboy
2014/05/01 20:06:59
nit: .. then |callback| is called ...
Fady Samuel
2014/05/01 21:05:28
Removed this entirely.
|
| + typedef base::Callback<void(int)> InstanceIDResponseCallback; |
| + virtual void RequestInstanceID(const std::string& src, |
| + const InstanceIDResponseCallback& callback) {} |
| + |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_MANAGER_DELEGATE_H_ |