Backout bug 345517 due to various issues.
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
#include "gfxIImageFrame.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "imgIRequest.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMHTMLImageElement.h"
|
||||
@@ -56,6 +57,7 @@
|
||||
#include "nsIProcess.h"
|
||||
#include "nsICategoryManager.h"
|
||||
#include "nsBrowserCompsCID.h"
|
||||
#include "nsNativeCharsetUtils.h"
|
||||
#include "nsDirectoryServiceUtils.h"
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
|
||||
@@ -450,13 +452,12 @@ nsWindowsShellService::SetDefaultBrowser(PRBool aClaimAllTypes, PRBool aForAllUs
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Create the Start Menu item if it doesn't exist
|
||||
nsString brandFullName;
|
||||
nsXPIDLString brandFullName;
|
||||
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandFullName").get(),
|
||||
getter_Copies(brandFullName));
|
||||
nsCAutoString nativeFullName;
|
||||
// For the now, we use 'A' APIs (see bug 240272, 239279)
|
||||
NS_UTF16ToCString(brandFullName, NS_CSTRING_ENCODING_NATIVE_FILESYSTEM,
|
||||
nativeFullName);
|
||||
NS_CopyUnicodeToNative(brandFullName, nativeFullName);
|
||||
|
||||
nsCAutoString key1(NS_LITERAL_CSTRING(SMI));
|
||||
key1.Append(exeName);
|
||||
@@ -465,39 +466,35 @@ nsWindowsShellService::SetDefaultBrowser(PRBool aClaimAllTypes, PRBool aForAllUs
|
||||
backupKey, aClaimAllTypes, aForAllUsers);
|
||||
|
||||
// Set the Options and Safe Mode start menu context menu item labels
|
||||
nsCAutoString optionsKey(SMI);
|
||||
optionsKey.Append(exeName);
|
||||
optionsKey.Append("\\shell\\properties");
|
||||
nsCAutoString optionsKey(NS_LITERAL_CSTRING(SMI "%APPEXE%\\shell\\properties"));
|
||||
optionsKey.ReplaceSubstring("%APPEXE%", exeName.get());
|
||||
|
||||
nsCAutoString safeModeKey(SMI);
|
||||
safeModeKey.Append(exeName);
|
||||
safeModeKey.Append("\\shell\\safemode");
|
||||
nsCAutoString safeModeKey(NS_LITERAL_CSTRING(SMI "%APPEXE%\\shell\\safemode"));
|
||||
safeModeKey.ReplaceSubstring("%APPEXE%", exeName.get());
|
||||
|
||||
nsString brandShortName;
|
||||
nsXPIDLString brandShortName;
|
||||
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
|
||||
getter_Copies(brandShortName));
|
||||
|
||||
const PRUnichar* brandNameStrings[] = { brandShortName.get() };
|
||||
|
||||
// Set the Options menu item
|
||||
nsString optionsTitle;
|
||||
nsXPIDLString optionsTitle;
|
||||
bundle->FormatStringFromName(NS_LITERAL_STRING("optionsLabel").get(),
|
||||
brandNameStrings, 1, getter_Copies(optionsTitle));
|
||||
// Set the Safe Mode menu item
|
||||
nsString safeModeTitle;
|
||||
nsXPIDLString safeModeTitle;
|
||||
bundle->FormatStringFromName(NS_LITERAL_STRING("safeModeLabel").get(),
|
||||
brandNameStrings, 1, getter_Copies(safeModeTitle));
|
||||
|
||||
// Set the registry keys
|
||||
nsCAutoString nativeTitle;
|
||||
// For the now, we use 'A' APIs (see bug 240272, 239279)
|
||||
NS_UTF16ToCString(optionsTitle, NS_CSTRING_ENCODING_NATIVE_FILESYSTEM,
|
||||
nativeTitle);
|
||||
NS_CopyUnicodeToNative(optionsTitle, nativeTitle);
|
||||
SetRegKey(optionsKey.get(), "", nativeTitle.get(), PR_TRUE, backupKey,
|
||||
aClaimAllTypes, aForAllUsers);
|
||||
// For the now, we use 'A' APIs (see bug 240272, 239279)
|
||||
NS_UTF16ToCString(safeModeTitle, NS_CSTRING_ENCODING_NATIVE_FILESYSTEM,
|
||||
nativeTitle);
|
||||
NS_CopyUnicodeToNative(safeModeTitle, nativeTitle);
|
||||
SetRegKey(safeModeKey.get(), "", nativeTitle.get(), PR_TRUE, backupKey,
|
||||
aClaimAllTypes, aForAllUsers);
|
||||
|
||||
@@ -574,7 +571,7 @@ nsWindowsShellService::DeleteRegKey(HKEY baseKey, const char *keyName)
|
||||
|
||||
// Continue till we get an error or are done.
|
||||
while (rc == ERROR_SUCCESS) {
|
||||
char subkeyName[MAX_PATH];
|
||||
char subkeyName[_MAX_PATH];
|
||||
DWORD len = sizeof subkeyName;
|
||||
// Get first subkey name. Note that we always get the
|
||||
// first one, then delete it. So we need to get
|
||||
@@ -794,7 +791,7 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// e.g. "Desktop Background.bmp"
|
||||
nsString fileLeafName;
|
||||
nsXPIDLString fileLeafName;
|
||||
rv = shellBundle->GetStringFromName
|
||||
(NS_LITERAL_STRING("desktopBackgroundLeafNameWin").get(),
|
||||
getter_Copies(fileLeafName));
|
||||
@@ -1060,7 +1057,7 @@ nsWindowsShellService::GetMailAccountKey(HKEY* aResult)
|
||||
NS_IMETHODIMP
|
||||
nsWindowsShellService::Observe(nsISupports* aObject, const char* aTopic, const PRUnichar* aMessage)
|
||||
{
|
||||
if (!strcmp("app-startup", aTopic)) {
|
||||
if (!nsCRT::strcmp("app-startup", aTopic)) {
|
||||
PRBool isDefault;
|
||||
IsDefaultBrowser(PR_FALSE, &isDefault);
|
||||
if (!isDefault)
|
||||
@@ -1068,7 +1065,7 @@ nsWindowsShellService::Observe(nsISupports* aObject, const char* aTopic, const P
|
||||
|
||||
return RegisterDDESupport();
|
||||
}
|
||||
else if (!strcmp("quit-application", aTopic)) {
|
||||
else if (!nsCRT::strcmp("quit-application", aTopic)) {
|
||||
PRBool isDefault;
|
||||
IsDefaultBrowser(PR_FALSE, &isDefault);
|
||||
if (!isDefault)
|
||||
@@ -1096,7 +1093,7 @@ nsWindowsShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
const nsCString spec(aURI);
|
||||
const nsPromiseFlatCString& spec = PromiseFlatCString(aURI);
|
||||
const char* specStr = spec.get();
|
||||
PRUint32 pid;
|
||||
return process->Run(PR_FALSE, &specStr, 1, &pid);
|
||||
|
||||
Reference in New Issue
Block a user