b=634719 Add a helper to get the nsDragService r=roc

--HG--
extra : rebase_source : cd811aee525b1675b47573e313f6804112d78ef0
This commit is contained in:
Karl Tomlinson 2012-04-19 18:18:31 +12:00
parent 1f645ea274
commit 3eb6a4c206
2 changed files with 11 additions and 0 deletions

View File

@ -179,6 +179,15 @@ nsDragService::~nsDragService()
NS_IMPL_ISUPPORTS_INHERITED2(nsDragService, nsBaseDragService,
nsIDragSessionGTK, nsIObserver)
/* static */ nsDragService*
nsDragService::GetInstance()
{
static const nsIID iid = NS_DRAGSERVICE_CID;
nsCOMPtr<nsIDragService> dragService = do_GetService(iid);
return static_cast<nsDragService*>(dragService.get());
// We rely on XPCOM keeping a reference to the service.
}
// nsIObserver
NS_IMETHODIMP

View File

@ -98,6 +98,8 @@ public:
NS_IMETHOD TargetSetTimeCallback (nsIDragSessionGTKTimeCB aCallback);
static nsDragService* GetInstance();
// END PUBLIC API
// These methods are public only so that they can be called from functions