334747, 339893 - desktop application feed readers do not display their app name properly or launch with the specified feed on OSX due to lack of support for a function to get the application bundle name, and a method to invoke an application bundle on OS X with a URL. Add an attribute to nsILocalFileMac called bundleDisplayName to show the application's name, and a method to nsIShellService called openApplicationWithURL which launches an application with a URL parameter appropriately across platforms (nsIProcess on windows and linux, LaunchServices on OS X). Update the client code to use bundleDisplayName, and also the <filefield> binding in preferences to use it too. r=mark sr=darin

This commit is contained in:
beng@bengoodger.com
2006-06-27 22:38:55 +00:00
parent 1fb81c21bf
commit ec204208bd
9 changed files with 176 additions and 29 deletions

View File

@@ -49,6 +49,7 @@
#include "nsIStringBundle.h"
#include "gfxIImageFrame.h"
#include "nsIOutputStream.h"
#include "nsIProcess.h"
#include "nsNetUtil.h"
#include "nsIDOMHTMLImageElement.h"
#include "nsIImageLoadingContent.h"
@@ -541,3 +542,22 @@ nsGNOMEShellService::OpenApplication(PRInt32 aApplication)
return err ? NS_OK : NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsGNOMEShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const nsACString& aURI)
{
nsresult rv;
nsCOMPtr<nsIProcess> process =
do_CreateInstance("@mozilla.org/process/util;1", &rv);
if (NS_FAILED(rv))
return rv;
rv = process->Init(aApplication);
if (NS_FAILED(rv))
return rv;
const nsPromiseFlatCString& spec = PromiseFlatCString(aURI);
const char* specStr = spec.get();
PRUint32 pid;
return process->Run(PR_FALSE, &specStr, 1, &pid);
}