Bug 1374779 - Open address book dialog from privileged window. r=bz

This commit is contained in:
Jorg K 2017-06-22 07:25:56 +02:00
Родитель 98a3a47cd9
Коммит c7cfcf4bd0
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -13,6 +13,8 @@
#include "plstr.h"
#include "nsPIDOMWindow.h"
#include "mozIDOMWindow.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsMsgUtils.h"
#include "nsIMsgVCardService.h"
#include "nsIAbCard.h"
@ -89,9 +91,14 @@ nsAbContentHandler::HandleContent(const char *aContentType,
ifptr->SetData(cardFromVCard);
ifptr->SetDataIID(&NS_GET_IID(nsIAbCard));
nsCOMPtr<nsPIDOMWindowOuter> dialogWindow;
// Find a privileged chrome window to open the dialog from.
nsCOMPtr<nsIDocShell> docShell(parentWindow->GetDocShell());
nsCOMPtr<nsIDocShellTreeItem> root;
docShell->GetRootTreeItem(getter_AddRefs(root));
nsCOMPtr<nsPIDOMWindowOuter> window(do_GetInterface(root));
rv = parentWindow->OpenDialog(
nsCOMPtr<nsPIDOMWindowOuter> dialogWindow;
rv = window->OpenDialog(
NS_LITERAL_STRING("chrome://messenger/content/addressbook/abNewCardDialog.xul"),
EmptyString(),
NS_LITERAL_STRING("chrome,resizable=no,titlebar,modal,centerscreen"),