1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5include protocol PBrowser;
6
7include "mozilla/GfxMessageUtils.h";
8
9using nsIntRect from "nsRect.h";
10
11namespace mozilla {
12namespace plugins {
13
14/**
15 * PPluginWidget - a nsIWidget'ish protocol for windowed plugins in e10s.
16 * On windows and linux we create native widgets in chrome which we then manage
17 * from content.  On the content side there's PluginWidgetProxy which
18 * implements nsIWidget. We hand this around layout and plugins code. Anything
19 * not dealt with via PluginWidgetProxy falls through to PuppetWidget. Native
20 * widget exists on the chrome side (PluginWidgetParent) attached to the
21 * browser window as a child. Window management calls are forwarded from
22 * PluginWidgetProxy to PluginWidgetParent over this interface.
23 *
24 * Note lifetime management for PluginWidgetProxy (the plugin widget) and the
25 * connection (PluginWidgetChild) are separated. PluginWidgetChild will
26 * be torn down first by the tab, followed by the deref'ing of the nsIWidget
27 * via layout.
28 */
29sync protocol PPluginWidget {
30  manager PBrowser;
31
32parent:
33  async __delete__();
34
35  /**
36   * Used to set the ID of a scroll capture container from the parent process,
37   * so that we can create a proxy container in the layer tree.
38   * @param aScrollCaptureId async container ID of the parent container
39   * @param aPluginInstanceId plugin ID on which to set the scroll capture ID
40   */
41  sync Create() returns (nsresult aResult, uint64_t aScrollCaptureId,
42                         uintptr_t aPluginInstanceId);
43  async SetFocus(bool aRaise);
44
45  /**
46   * Returns NS_NATIVE_PLUGIN_PORT and its variants: a sharable native
47   * window for plugins. On Linux, this returns an XID for a socket widget
48   * embedded in the chrome side native window. On Windows this returns the
49   * native HWND of the plugin widget.
50   */
51  sync GetNativePluginPort() returns (uintptr_t value);
52
53  /**
54   * Sends an NS_NATIVE_CHILD_WINDOW to be adopted by the widget's native window
55   * on the chrome side. This is only currently used on Windows.
56   */
57  sync SetNativeChildWindow(uintptr_t childWindow);
58};
59
60}
61}
62