Indentation stuff
This commit is contained in:
parent
d4fab7fc64
commit
4016f12d86
@ -6,15 +6,12 @@
|
||||
|
||||
class GeckoContentHandler : public nsIHelperAppLauncherDialog
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIHELPERAPPLAUNCHERDIALOG
|
||||
|
||||
GeckoContentHandler();
|
||||
virtual ~GeckoContentHandler();
|
||||
|
||||
private:
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIHELPERAPPLAUNCHERDIALOG
|
||||
|
||||
GeckoContentHandler();
|
||||
virtual ~GeckoContentHandler();
|
||||
};
|
||||
|
||||
GeckoContentHandler::GeckoContentHandler()
|
||||
@ -75,42 +72,47 @@ GeckoContentHandlerFactory::GeckoContentHandlerFactory() {
|
||||
GeckoContentHandlerFactory::~GeckoContentHandlerFactory() {
|
||||
}
|
||||
|
||||
NS_IMETHODIMP GeckoContentHandlerFactory::CreateInstance(nsISupports *aOuter, const nsIID & aIID, void **aResult)
|
||||
NS_IMETHODIMP
|
||||
GeckoContentHandlerFactory::CreateInstance(nsISupports *aOuter,
|
||||
const nsIID & aIID,
|
||||
void **aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
|
||||
*aResult = NULL;
|
||||
GeckoContentHandler *inst = new GeckoContentHandler;
|
||||
if (!inst)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
*aResult = NULL;
|
||||
GeckoContentHandler *inst = new GeckoContentHandler;
|
||||
if (!inst)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
nsresult rv = inst->QueryInterface(aIID, aResult);
|
||||
if (rv != NS_OK) {
|
||||
// We didn't get the right interface, so clean up
|
||||
delete inst;
|
||||
}
|
||||
nsresult rv = inst->QueryInterface(aIID, aResult);
|
||||
if (rv != NS_OK) {
|
||||
// We didn't get the right interface, so clean up
|
||||
delete inst;
|
||||
}
|
||||
|
||||
return rv;
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP GeckoContentHandlerFactory::LockFactory(PRBool lock)
|
||||
NS_IMETHODIMP
|
||||
GeckoContentHandlerFactory::LockFactory(PRBool lock)
|
||||
{
|
||||
return NS_OK;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
|
||||
nsresult NS_NewGeckoContentHandlerFactory(nsIFactory** aFactory)
|
||||
nsresult
|
||||
NS_NewGeckoContentHandlerFactory(nsIFactory** aFactory)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aFactory);
|
||||
*aFactory = nsnull;
|
||||
NS_ENSURE_ARG_POINTER(aFactory);
|
||||
*aFactory = nsnull;
|
||||
|
||||
GeckoContentHandlerFactory *result = new GeckoContentHandlerFactory;
|
||||
if (!result)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
GeckoContentHandlerFactory *result = new GeckoContentHandlerFactory;
|
||||
if (!result)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(result);
|
||||
*aFactory = result;
|
||||
NS_ADDREF(result);
|
||||
*aFactory = result;
|
||||
|
||||
return NS_OK;
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -153,11 +153,11 @@ GeckoDownload::OnSecurityChange (nsIWebProgress *aWebProgress,
|
||||
|
||||
class GeckoDownloadFactory : public nsIFactory {
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIFACTORY
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIFACTORY
|
||||
|
||||
GeckoDownloadFactory();
|
||||
virtual ~GeckoDownloadFactory();
|
||||
GeckoDownloadFactory();
|
||||
virtual ~GeckoDownloadFactory();
|
||||
};
|
||||
|
||||
//*****************************************************************************
|
||||
@ -170,42 +170,45 @@ GeckoDownloadFactory::GeckoDownloadFactory() {
|
||||
GeckoDownloadFactory::~GeckoDownloadFactory() {
|
||||
}
|
||||
|
||||
NS_IMETHODIMP GeckoDownloadFactory::CreateInstance(nsISupports *aOuter, const nsIID & aIID, void **aResult)
|
||||
NS_IMETHODIMP
|
||||
GeckoDownloadFactory::CreateInstance(nsISupports *aOuter, const nsIID & aIID, void **aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
|
||||
*aResult = NULL;
|
||||
GeckoDownload *inst = new GeckoDownload;
|
||||
if (!inst)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
*aResult = NULL;
|
||||
GeckoDownload *inst = new GeckoDownload;
|
||||
if (!inst)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
nsresult rv = inst->QueryInterface(aIID, aResult);
|
||||
if (rv != NS_OK) {
|
||||
// We didn't get the right interface, so clean up
|
||||
delete inst;
|
||||
}
|
||||
nsresult rv = inst->QueryInterface(aIID, aResult);
|
||||
if (rv != NS_OK) {
|
||||
// We didn't get the right interface, so clean up
|
||||
delete inst;
|
||||
}
|
||||
|
||||
return rv;
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP GeckoDownloadFactory::LockFactory(PRBool lock)
|
||||
NS_IMETHODIMP
|
||||
GeckoDownloadFactory::LockFactory(PRBool lock)
|
||||
{
|
||||
return NS_OK;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
|
||||
nsresult NS_NewGeckoDownloadFactory(nsIFactory** aFactory)
|
||||
nsresult
|
||||
NS_NewGeckoDownloadFactory(nsIFactory** aFactory)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aFactory);
|
||||
*aFactory = nsnull;
|
||||
NS_ENSURE_ARG_POINTER(aFactory);
|
||||
*aFactory = nsnull;
|
||||
|
||||
GeckoDownloadFactory *result = new GeckoDownloadFactory;
|
||||
if (!result)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
GeckoDownloadFactory *result = new GeckoDownloadFactory;
|
||||
if (!result)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(result);
|
||||
*aFactory = result;
|
||||
NS_ADDREF(result);
|
||||
*aFactory = result;
|
||||
|
||||
return NS_OK;
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -116,23 +116,23 @@ sugar_browser_startup(const char *profile_path, const char *profile_name)
|
||||
NS_GetComponentRegistrar(getter_AddRefs(componentRegistrar));
|
||||
NS_ENSURE_TRUE (componentRegistrar, FALSE);
|
||||
|
||||
nsCOMPtr<nsIFactory> contentHandlerFactory;
|
||||
rv = NS_NewGeckoContentHandlerFactory(getter_AddRefs(contentHandlerFactory));
|
||||
rv = componentRegistrar->RegisterFactory(sSugarComponents[0].mCID,
|
||||
sSugarComponents[0].mDescription,
|
||||
sSugarComponents[0].mContractID,
|
||||
contentHandlerFactory);
|
||||
nsCOMPtr<nsIFactory> contentHandlerFactory;
|
||||
rv = NS_NewGeckoContentHandlerFactory(getter_AddRefs(contentHandlerFactory));
|
||||
rv = componentRegistrar->RegisterFactory(sSugarComponents[0].mCID,
|
||||
sSugarComponents[0].mDescription,
|
||||
sSugarComponents[0].mContractID,
|
||||
contentHandlerFactory);
|
||||
if (NS_FAILED(rv)) {
|
||||
g_warning ("Failed to register factory for %s\n", sSugarComponents[0].mDescription);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIFactory> downloadFactory;
|
||||
rv = NS_NewGeckoDownloadFactory(getter_AddRefs(downloadFactory));
|
||||
rv = componentRegistrar->RegisterFactory(sSugarComponents[1].mCID,
|
||||
sSugarComponents[1].mDescription,
|
||||
sSugarComponents[1].mContractID,
|
||||
downloadFactory);
|
||||
nsCOMPtr<nsIFactory> downloadFactory;
|
||||
rv = NS_NewGeckoDownloadFactory(getter_AddRefs(downloadFactory));
|
||||
rv = componentRegistrar->RegisterFactory(sSugarComponents[1].mCID,
|
||||
sSugarComponents[1].mDescription,
|
||||
sSugarComponents[1].mContractID,
|
||||
downloadFactory);
|
||||
if (NS_FAILED(rv)) {
|
||||
g_warning ("Failed to register factory for %s\n", sSugarComponents[1].mDescription);
|
||||
return FALSE;
|
||||
@ -372,7 +372,6 @@ sugar_browser_scroll_pixels(SugarBrowser *browser,
|
||||
int dx,
|
||||
int dy)
|
||||
{
|
||||
#ifndef HAVE_GECKO_1_9
|
||||
nsCOMPtr<nsIWebBrowser> webBrowser;
|
||||
gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED(browser),
|
||||
getter_AddRefs(webBrowser));
|
||||
@ -390,7 +389,6 @@ sugar_browser_scroll_pixels(SugarBrowser *browser,
|
||||
NS_ENSURE_TRUE (DOMWindow, );
|
||||
|
||||
DOMWindow->ScrollBy (dx, dy);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user