зеркало из https://github.com/mozilla/gecko-dev.git
move the nsICmdLineHandler responsibility out of nsMessenger and into nsMessengerBootstrap. r=alecf
This commit is contained in:
Родитель
91f9e59318
Коммит
102f5c8902
|
@ -440,15 +440,15 @@ struct Components {
|
|||
// The list of components we register
|
||||
static Components gComponents[] = {
|
||||
{ "Netscape Messenger Bootstrapper", &kCMessengerBootstrapCID,
|
||||
NS_MESSENGERBOOTSTRAP_PROGID },
|
||||
NS_MESSENGERBOOTSTRAP_PROGID,
|
||||
nsMessengerBootstrap::RegisterProc,
|
||||
nsMessengerBootstrap::UnregisterProc },
|
||||
{ "UrlListenerManager", &kCUrlListenerManagerCID,
|
||||
NS_URLLISTENERMANAGER_PROGID },
|
||||
{ "Mail Session", &kCMsgMailSessionCID,
|
||||
NS_MSGMAILSESSION_PROGID },
|
||||
{ "Messenger DOM interaction object", &kCMessengerCID,
|
||||
NS_MESSENGER_PROGID,
|
||||
nsMessenger::RegisterProc,
|
||||
nsMessenger::UnregisterProc },
|
||||
NS_MESSENGER_PROGID },
|
||||
{ "Messenger Account Manager", &kMsgAccountManagerCID,
|
||||
NS_MSGACCOUNTMANAGER_PROGID },
|
||||
{ "Messenger Migrator", &kMessengerMigratorCID,
|
||||
|
|
|
@ -228,9 +228,8 @@ nsMessenger::~nsMessenger()
|
|||
NS_IF_RELEASE(mWindow);
|
||||
}
|
||||
|
||||
NS_IMPL_THREADSAFE_ADDREF(nsMessenger);
|
||||
NS_IMPL_THREADSAFE_RELEASE(nsMessenger);
|
||||
NS_IMPL_QUERY_INTERFACE2(nsMessenger, nsIMessenger, nsICmdLineHandler);
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsMessenger, NS_GET_IID(nsIMessenger))
|
||||
|
||||
nsresult
|
||||
nsMessenger::GetNewMessages(nsIRDFCompositeDataSource *db,
|
||||
|
@ -1500,5 +1499,3 @@ nsSaveAsListener::OnDataAvailable(nsIChannel* aChannel,
|
|||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
CMDLINEHANDLER_IMPL(nsMessenger,"-mail","general.startup.mail","chrome://messenger/content/","Start with mail.",NS_MESSENGER_PROGID,"Mail Cmd Line Handler",PR_FALSE,"", PR_TRUE)
|
||||
|
|
|
@ -31,9 +31,8 @@
|
|||
#include "nsIDocumentLoaderObserver.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsIWebShell.h"
|
||||
#include "nsICmdLineHandler.h"
|
||||
|
||||
class nsMessenger : public nsIMessenger, public nsICmdLineHandler
|
||||
class nsMessenger : public nsIMessenger
|
||||
{
|
||||
|
||||
public:
|
||||
|
@ -43,9 +42,7 @@ public:
|
|||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_DECL_NSIMESSENGER
|
||||
NS_DECL_NSICMDLINEHANDLER
|
||||
|
||||
CMDLINEHANDLER_REGISTERPROC_DECLS
|
||||
|
||||
|
||||
protected:
|
||||
nsresult DoDelete(nsIRDFCompositeDataSource* db, nsISupportsArray *srcArray, nsISupportsArray *deletedArray);
|
||||
|
|
|
@ -31,14 +31,15 @@
|
|||
|
||||
static NS_DEFINE_CID(kCMsgMailSessionCID, NS_MSGMAILSESSION_CID);
|
||||
static NS_DEFINE_CID(kMsgAccountManagerCID, NS_MSGACCOUNTMANAGER_CID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsMessengerBootstrap, NS_GET_IID(nsIAppShellComponent))
|
||||
NS_IMPL_THREADSAFE_ADDREF(nsMessengerBootstrap);
|
||||
NS_IMPL_THREADSAFE_RELEASE(nsMessengerBootstrap);
|
||||
NS_IMPL_QUERY_INTERFACE2(nsMessengerBootstrap, nsIAppShellComponent, nsICmdLineHandler);
|
||||
|
||||
nsMessengerBootstrap::nsMessengerBootstrap()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
}
|
||||
|
||||
nsMessengerBootstrap::~nsMessengerBootstrap()
|
||||
|
@ -50,8 +51,12 @@ nsMessengerBootstrap::Initialize(nsIAppShellService*,
|
|||
nsICmdLineService*)
|
||||
{
|
||||
nsresult rv;
|
||||
rv = nsServiceManager::RegisterService( "component://netscape/appshell/component/messenger", this );
|
||||
|
||||
nsCOMPtr<nsISupports> bootstrapper;
|
||||
rv = this->QueryInterface(kISupportsIID, getter_AddRefs(bootstrapper));
|
||||
if (NS_SUCCEEDED(rv) && bootstrapper) {
|
||||
rv = nsServiceManager::RegisterService( "component://netscape/appshell/component/messenger", bootstrapper);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -63,3 +68,4 @@ nsMessengerBootstrap::Shutdown()
|
|||
}
|
||||
|
||||
|
||||
CMDLINEHANDLER_IMPL(nsMessengerBootstrap,"-mail","general.startup.mail","chrome://messenger/content/","Start with mail.",NS_MESSENGERBOOTSTRAP_PROGID,"Mail Cmd Line Handler",PR_FALSE,"", PR_TRUE)
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "nsIServiceManager.h"
|
||||
#include "nsIAppShellService.h"
|
||||
#include "nsIAppShellComponent.h"
|
||||
#include "nsICmdLineHandler.h"
|
||||
|
||||
#define NS_MESSENGERBOOTSTRAP_CID \
|
||||
{ /* 4a85a5d0-cddd-11d2-b7f6-00805f05ffa5 */ \
|
||||
|
@ -35,15 +36,16 @@
|
|||
{0xb7, 0xf6, 0x00, 0x80, 0x5f, 0x05, 0xff, 0xa5}}
|
||||
|
||||
|
||||
class nsMessengerBootstrap : public nsIAppShellComponent {
|
||||
class nsMessengerBootstrap : public nsIAppShellComponent, public nsICmdLineHandler {
|
||||
|
||||
public:
|
||||
nsMessengerBootstrap();
|
||||
virtual ~nsMessengerBootstrap();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIAPPSHELLCOMPONENT
|
||||
NS_DECL_NSICMDLINEHANDLER
|
||||
CMDLINEHANDLER_REGISTERPROC_DECLS
|
||||
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче