Bug 1338172 part E - make all the PPluginWidget stuff Windows-only. Rip out the GTK-specific native widget support from widget/gtk/nsWindow and elsewhere, r=jimm

MozReview-Commit-ID: J6E8sYcyX4U
This commit is contained in:
Benjamin Smedberg
2017-02-09 11:53:50 -05:00
parent a32f779345
commit 6313586298
20 changed files with 106 additions and 874 deletions

View File

@@ -3344,8 +3344,6 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void)
{
NS_ENSURE_TRUE(mPluginWindow, NS_ERROR_NULL_POINTER);
nsresult rv = NS_ERROR_FAILURE;
// Can't call this twice!
if (mWidget) {
NS_WARNING("Trying to create a plugin widget twice!");
@@ -3355,15 +3353,21 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void)
bool windowless = false;
mInstance->IsWindowless(&windowless);
if (!windowless) {
#ifndef XP_WIN
// Only Windows supports windowed mode!
MOZ_ASSERT_UNREACHABLE();
return NS_ERROR_FAILURE;
#else
// Try to get a parent widget, on some platforms widget creation will fail without
// a parent.
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIWidget> parentWidget;
nsIDocument *doc = nullptr;
nsCOMPtr<nsIContent> content = do_QueryReferent(mContent);
if (content) {
doc = content->OwnerDoc();
parentWidget = nsContentUtils::WidgetForDocument(doc);
#ifndef XP_MACOSX
// If we're running in the content process, we need a remote widget created in chrome.
if (XRE_IsContentProcess()) {
if (nsCOMPtr<nsPIDOMWindowOuter> window = doc->GetWindow()) {
@@ -3379,16 +3383,13 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void)
}
}
}
#endif // XP_MACOSX
}
#ifndef XP_MACOSX
// A failure here is terminal since we can't fall back on the non-e10s code
// path below.
if (!mWidget && XRE_IsContentProcess()) {
return NS_ERROR_UNEXPECTED;
}
#endif // XP_MACOSX
if (!mWidget) {
// native (single process)
@@ -3410,6 +3411,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void)
mWidget->EnableDragDrop(true);
mWidget->Show(false);
mWidget->Enable(false);
#endif // XP_WIN
}
if (mPluginFrame) {