summaryrefslogtreecommitdiffstats
path: root/chromium/content/public/browser/browser_plugin_guest_delegate.h
blob: 51a4efa8163208a5cf9468c8ba72afa89fe79e5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2013 The Chromium Authors
// 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_DELEGATE_H_
#define CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_

#include "content/common/content_export.h"
#include "content/public/browser/web_contents.h"

namespace content {
class RenderFrameHost;

// Objects implement this interface to get notified about changes in the guest
// WebContents and to provide necessary functionality.
class CONTENT_EXPORT BrowserPluginGuestDelegate {
 public:
  virtual ~BrowserPluginGuestDelegate() = default;

  virtual std::unique_ptr<WebContents> CreateNewGuestWindow(
      const WebContents::CreateParams& create_params);

  // Returns the WebContents that currently owns this guest.
  virtual WebContents* GetOwnerWebContents();

  // Returns the RenderFrameHost that owns this guest, but has not yet attached
  // it.
  // TODO(crbug.com/769461): Have all guest types return the specific owner
  // RenderFrameHost and not assume it's the owner's main frame.
  virtual RenderFrameHost* GetProspectiveOuterDocument();
};

}  // namespace content

#endif  // CONTENT_PUBLIC_BROWSER_BROWSER_PLUGIN_GUEST_DELEGATE_H_