Bug 563114 - Remove nsINonBlockingAlertService. r=karlt, r=bsmedberg, sr=roc

This commit is contained in:
Justin Dolske 2010-05-04 17:41:07 -07:00
parent afeaf2a57a
commit de107f9d91
7 changed files with 5 additions and 131 deletions

View File

@ -76,18 +76,6 @@
#define NS_PROMPTSERVICE_CONTRACTID \
"@mozilla.org/embedcomp/prompt-service;1"
/**
* Non Blocking Alert Service ContractID
* This service is for posing non blocking alerts to the user.
*
* This contract implements the following interfaces:
* nsINonBlockingAlertService
*
* Embedders may override this ContractID with their own implementation.
*/
#define NS_NONBLOCKINGALERTSERVICE_CONTRACTID \
"@mozilla.org/embedcomp/nbalert-service;1"
/**
* This contract ID should be implemented by password managers to be able to
* override the standard implementation of nsIAuthPrompt2. It will be used as

View File

@ -133,7 +133,6 @@ static const nsModuleComponentInfo gComponents[] = {
#ifdef MOZ_XUL
{ "Dialog ParamBlock", NS_DIALOGPARAMBLOCK_CID, NS_DIALOGPARAMBLOCK_CONTRACTID, nsDialogParamBlockConstructor },
{ "Prompt Service", NS_PROMPTSERVICE_CID, NS_PROMPTSERVICE_CONTRACTID, nsPromptServiceConstructor },
{ "Nonblocking Alert Service", NS_PROMPTSERVICE_CID, NS_NONBLOCKINGALERTSERVICE_CONTRACTID, nsPromptServiceConstructor },
#ifdef NS_PRINTING
#ifndef WINCE
{ "Printing Prompt Service", NS_PRINTINGPROMPTSERVICE_CID, NS_PRINTINGPROMPTSERVICE_CONTRACTID, nsPrintingPromptServiceConstructor },

View File

@ -57,7 +57,6 @@ XPIDLSRCS = nsIDialogParamBlock.idl \
nsPIWindowWatcher.idl \
nsIAuthPromptWrapper.idl \
nsIPromptFactory.idl \
nsINonBlockingAlertService.idl \
$(NULL)
EXPORTS = nsPromptUtils.h \

View File

@ -1,67 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* YAMASHITA Makoto <makotoy@ms.u-tokyo.ac.jp>.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
interface nsIDOMWindow;
/**
* This is the interface to the embeddable non-blocking alert
* service. A non-blocking alert is a less serious informative alert
* that does not need to block the program's execution to get the
* user's response.
*
* The way to present the alert is left to the implementations. It
* may be a dialog separate from the parent window, or a window-modal
* sheet (as the ones in Mac OS X) attached to the parent.
*/
[scriptable, uuid(E800EF97-AE37-46B7-A46C-31FBE79657EA)]
interface nsINonBlockingAlertService : nsISupports {
/**
* This shows a non-blocking alert with the specified title and
* message text. This function requires a valid parent window with
* which the alert is associated.
*
* @param aParent
* The parent window. This must not be null.
* @param aDialogTitle
* Text to appear in the title of the alert.
* @param aText
* Text to appear in the body of the alert.
*/
void showNonBlockingAlert(in nsIDOMWindow aParent,
in wstring aDialogTitle, in wstring aText);
};

View File

@ -90,8 +90,8 @@ private:
************************ nsPromptService ***********************
****************************************************************/
NS_IMPL_ISUPPORTS4(nsPromptService, nsIPromptService, nsIPromptService2,
nsPIPromptService, nsINonBlockingAlertService)
NS_IMPL_ISUPPORTS3(nsPromptService, nsIPromptService, nsIPromptService2,
nsPIPromptService)
nsPromptService::nsPromptService() {
}
@ -739,34 +739,6 @@ nsPromptService::Select(nsIDOMWindow *parent, const PRUnichar *dialogTitle,
return rv;
}
/* void showNonBlockingAlert (in nsIDOMWindow aParent, in wstring aDialogTitle, in wstring aText); */
NS_IMETHODIMP
nsPromptService::ShowNonBlockingAlert(nsIDOMWindow *aParent,
const PRUnichar *aDialogTitle,
const PRUnichar *aText)
{
NS_ENSURE_ARG(aParent);
if (!mWatcher)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDialogParamBlock> paramBlock(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
if (!paramBlock)
return NS_ERROR_FAILURE;
paramBlock->SetInt(eNumberButtons, 1);
paramBlock->SetString(eIconClass, NS_LITERAL_STRING("alert-icon").get());
paramBlock->SetString(eDialogTitle, aDialogTitle);
paramBlock->SetString(eMsg, aText);
paramBlock->SetString(eOpeningSound, NS_SYSSOUND_ALERT_DIALOG.get());
paramBlock->SetInt(eSoundEventId, nsISound::EVENT_ALERT_DIALOG_OPEN);
nsCOMPtr<nsIDOMWindow> dialog;
mWatcher->OpenWindow(aParent, "chrome://global/content/commonDialog.xul",
"_blank", "dependent,centerscreen,chrome,titlebar",
paramBlock, getter_AddRefs(dialog));
return NS_OK;
}
nsresult
nsPromptService::DoDialog(nsIDOMWindow *aParent,
nsIDialogParamBlock *aParamBlock, const char *aChromeURL)

View File

@ -48,7 +48,6 @@
#include "nsCOMPtr.h"
#include "nsIPromptService2.h"
#include "nsPIPromptService.h"
#include "nsINonBlockingAlertService.h"
#include "nsIWindowWatcher.h"
#include "nsAutoWindowStateHelper.h"
@ -56,8 +55,7 @@ class nsIDOMWindow;
class nsIDialogParamBlock;
class nsPromptService: public nsIPromptService2,
public nsPIPromptService,
public nsINonBlockingAlertService {
public nsPIPromptService {
public:
@ -69,7 +67,6 @@ public:
NS_DECL_NSIPROMPTSERVICE
NS_DECL_NSIPROMPTSERVICE2
NS_DECL_NSPIPROMPTSERVICE
NS_DECL_NSINONBLOCKINGALERTSERVICE
NS_DECL_ISUPPORTS
private:

View File

@ -65,9 +65,6 @@
#include "prprf.h" // For PR_snprintf()
#if ALERT_MISSING_FONTS
#include "nsIDOMWindow.h"
#include "nsINonBlockingAlertService.h"
#include "nsIWindowWatcher.h"
#include "nsIStringBundle.h"
#endif
#include "nsDisplayList.h"
@ -169,19 +166,8 @@ AlertMissingFonts(nsString& aMissingFonts)
sb->FormatStringFromName(NS_LITERAL_STRING("mathfont_missing_dialog_message").get(),
strings, 1, getter_Copies(message));
nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
if (!wwatch)
return;
nsCOMPtr<nsIDOMWindow> parent;
wwatch->GetActiveWindow(getter_AddRefs(parent));
nsresult rv;
nsCOMPtr<nsINonBlockingAlertService> prompter =
do_GetService("@mozilla.org/embedcomp/nbalert-service;1", &rv);
if (prompter && parent) {
prompter->ShowNonBlockingAlert(parent, title.get(), message.get());
}
// XXX Bug 309090 - could show a notification bar here. Bug 563114 removed
// the nsINonBlockingAlertService interface that was previously used here.
}
#endif