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

@@ -54,6 +54,7 @@
#include "nsShellService.h"
#include "nsWindowsShellService.h"
#include "nsIObserverService.h"
#include "nsIProcess.h"
#include "nsICategoryManager.h"
#include "nsBrowserCompsCID.h"
#include "nsNativeCharsetUtils.h"
@@ -1079,3 +1080,22 @@ nsWindowsShellService::Observe(nsISupports* aObject, const char* aTopic, const P
return NS_OK;
}
NS_IMETHODIMP
nsWindowsShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const ACString& 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);
}