1
--- a/browser/components/shell/src/nsGNOMEShellService.cpp
2
+++ b/browser/components/shell/src/nsGNOMEShellService.cpp
7
+#define SYSTEM_PATH_BUILD 1
9
struct ProtocolAssociation
12
@@ -132,6 +134,24 @@ nsGNOMEShellService::Init()
13
rv = appPath->AppendNative(NS_LITERAL_CSTRING(MOZ_APP_NAME));
14
NS_ENSURE_SUCCESS(rv, rv);
16
+ nsCOMPtr<nsIStringBundleService> bundleService =
17
+ do_GetService(NS_STRINGBUNDLE_CONTRACTID);
18
+ NS_ENSURE_TRUE(bundleService, NS_ERROR_OUT_OF_MEMORY);
20
+ nsCOMPtr<nsIStringBundle> brandBundle;
21
+ bundleService->CreateBundle(BRAND_PROPERTIES, getter_AddRefs(brandBundle));
22
+ NS_ENSURE_TRUE(brandBundle, NS_ERROR_FAILURE);
24
+ nsString brandShortName;
25
+ rv = brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
26
+ getter_Copies(brandShortName));
28
+ if (brandShortName.Equals(NS_LITERAL_STRING("Web Browser"))) {
29
+ mSystemAppPath.Assign (NS_LITERAL_CSTRING("/usr/bin/" "abrowser"));
31
+ mSystemAppPath.Assign (NS_LITERAL_CSTRING("/usr/bin/" MOZ_APP_NAME));
34
return appPath->GetNativePath(mAppPath);
37
@@ -140,7 +160,6 @@ NS_IMPL_ISUPPORTS1(nsGNOMEShellService,
39
nsGNOMEShellService::KeyMatchesAppName(const char *aKeyValue) const
43
if (mUseLocaleFilenames) {
44
gchar *nativePath = g_filename_from_utf8(aKeyValue, -1, NULL, NULL, NULL);
45
@@ -158,9 +177,15 @@ nsGNOMEShellService::KeyMatchesAppName(c
49
+#ifdef SYSTEM_PATH_BUILD
50
+ PRBool matches = mSystemAppPath.Equals(commandPath);
51
+ g_free(commandPath);
54
PRBool matches = mAppPath.Equals(commandPath);
61
@@ -215,8 +240,12 @@ nsGNOMEShellService::SetDefaultBrowser(P
63
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
65
+#ifdef SYSTEM_PATH_BUILD
66
+ nsCAutoString appKeyValue(mSystemAppPath);
68
nsCAutoString appKeyValue(mAppPath);
69
- appKeyValue.Append(" \"%s\"");
71
+ appKeyValue.Append(" %s");
72
for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) {
73
if (appProtocols[i].essential || aClaimAllTypes) {
74
gconf->SetAppForProtocol(nsDependentCString(appProtocols[i].name),
75
--- a/browser/components/shell/src/nsGNOMEShellService.h
76
+++ b/browser/components/shell/src/nsGNOMEShellService.h
77
@@ -58,6 +58,7 @@ private:
78
PRPackedBool mCheckedThisSession;
79
PRPackedBool mUseLocaleFilenames;
81
+ nsCString mSystemAppPath;
84
#endif // nsgnomeshellservice_h____