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