Lines 114-119
Link Here
|
114 |
#include "nsIXULAppInfo.h" |
114 |
#include "nsIXULAppInfo.h" |
115 |
#include "nsIXULRuntime.h" |
115 |
#include "nsIXULRuntime.h" |
116 |
#include "nsPresShellIterator.h" |
116 |
#include "nsPresShellIterator.h" |
|
|
117 |
#include "nsKDEUtils.h" |
117 |
|
118 |
|
118 |
#ifdef MOZ_XUL |
119 |
#ifdef MOZ_XUL |
119 |
// keep all the RDF stuff together, in case we can remove it in the far future |
120 |
// keep all the RDF stuff together, in case we can remove it in the far future |
Lines 2208-2213
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2208 |
NS_NAMED_LITERAL_STRING(kAppVersion, "appversion"); |
2209 |
NS_NAMED_LITERAL_STRING(kAppVersion, "appversion"); |
2209 |
NS_NAMED_LITERAL_STRING(kOs, "os"); |
2210 |
NS_NAMED_LITERAL_STRING(kOs, "os"); |
2210 |
NS_NAMED_LITERAL_STRING(kOsVersion, "osversion"); |
2211 |
NS_NAMED_LITERAL_STRING(kOsVersion, "osversion"); |
|
|
2212 |
NS_NAMED_LITERAL_STRING(kDesktop, "desktop"); |
2211 |
|
2213 |
|
2212 |
nsCOMPtr<nsIIOService> io (do_GetIOService()); |
2214 |
nsCOMPtr<nsIIOService> io (do_GetIOService()); |
2213 |
if (!io) return NS_ERROR_FAILURE; |
2215 |
if (!io) return NS_ERROR_FAILURE; |
Lines 2251-2256
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2251 |
} |
2253 |
} |
2252 |
|
2254 |
|
2253 |
nsAutoString osVersion; |
2255 |
nsAutoString osVersion; |
|
|
2256 |
nsAutoString desktop; |
2254 |
#if defined(XP_WIN) |
2257 |
#if defined(XP_WIN) |
2255 |
OSVERSIONINFO info = { sizeof(OSVERSIONINFO) }; |
2258 |
OSVERSIONINFO info = { sizeof(OSVERSIONINFO) }; |
2256 |
if (GetVersionEx(&info)) { |
2259 |
if (GetVersionEx(&info)) { |
Lines 2258-2263
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2258 |
info.dwMajorVersion, |
2261 |
info.dwMajorVersion, |
2259 |
info.dwMinorVersion); |
2262 |
info.dwMinorVersion); |
2260 |
} |
2263 |
} |
|
|
2264 |
desktop = NS_LITERAL_STRING("win"); |
2261 |
#elif defined(XP_MACOSX) |
2265 |
#elif defined(XP_MACOSX) |
2262 |
long majorVersion, minorVersion; |
2266 |
long majorVersion, minorVersion; |
2263 |
if ((Gestalt(gestaltSystemVersionMajor, &majorVersion) == noErr) && |
2267 |
if ((Gestalt(gestaltSystemVersionMajor, &majorVersion) == noErr) && |
Lines 2266-2275
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2266 |
majorVersion, |
2270 |
majorVersion, |
2267 |
minorVersion); |
2271 |
minorVersion); |
2268 |
} |
2272 |
} |
|
|
2273 |
desktop = NS_LITERAL_STRING("macosx"); |
2269 |
#elif defined(MOZ_WIDGET_GTK2) |
2274 |
#elif defined(MOZ_WIDGET_GTK2) |
2270 |
nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(), |
2275 |
nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(), |
2271 |
gtk_major_version, |
2276 |
gtk_major_version, |
2272 |
gtk_minor_version); |
2277 |
gtk_minor_version); |
|
|
2278 |
desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome"); // TODO others? |
2273 |
#endif |
2279 |
#endif |
2274 |
|
2280 |
|
2275 |
char *token; |
2281 |
char *token; |
Lines 2313-2318
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2313 |
TriState stApp = eUnspecified; |
2319 |
TriState stApp = eUnspecified; |
2314 |
TriState stOsVersion = eUnspecified; |
2320 |
TriState stOsVersion = eUnspecified; |
2315 |
TriState stOs = eUnspecified; |
2321 |
TriState stOs = eUnspecified; |
|
|
2322 |
TriState stDesktop = eUnspecified; |
2316 |
|
2323 |
|
2317 |
PRBool badFlag = PR_FALSE; |
2324 |
PRBool badFlag = PR_FALSE; |
2318 |
|
2325 |
|
Lines 2326-2331
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2326 |
CheckFlag(kContentAccessible, wtoken, contentAccessible) || |
2333 |
CheckFlag(kContentAccessible, wtoken, contentAccessible) || |
2327 |
CheckStringFlag(kApplication, wtoken, appID, stApp) || |
2334 |
CheckStringFlag(kApplication, wtoken, appID, stApp) || |
2328 |
CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
2335 |
CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
|
2336 |
CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
2329 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
2337 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
2330 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
2338 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
2331 |
continue; |
2339 |
continue; |
Lines 2337-2343
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2337 |
} |
2345 |
} |
2338 |
|
2346 |
|
2339 |
if (badFlag || stApp == eBad || stAppVersion == eBad || |
2347 |
if (badFlag || stApp == eBad || stAppVersion == eBad || |
2340 |
stOs == eBad || stOsVersion == eBad) |
2348 |
stOs == eBad || stOsVersion == eBad || stDesktop == eBad) |
2341 |
continue; |
2349 |
continue; |
2342 |
|
2350 |
|
2343 |
nsCOMPtr<nsIURI> resolved; |
2351 |
nsCOMPtr<nsIURI> resolved; |
Lines 2398-2403
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2398 |
TriState stApp = eUnspecified; |
2406 |
TriState stApp = eUnspecified; |
2399 |
TriState stOs = eUnspecified; |
2407 |
TriState stOs = eUnspecified; |
2400 |
TriState stOsVersion = eUnspecified; |
2408 |
TriState stOsVersion = eUnspecified; |
|
|
2409 |
TriState stDesktop = eUnspecified; |
2401 |
|
2410 |
|
2402 |
PRBool badFlag = PR_FALSE; |
2411 |
PRBool badFlag = PR_FALSE; |
2403 |
|
2412 |
|
Lines 2408-2413
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2408 |
|
2417 |
|
2409 |
if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
2418 |
if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
2410 |
CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
2419 |
CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
|
2420 |
CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
2411 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
2421 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
2412 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
2422 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
2413 |
continue; |
2423 |
continue; |
Lines 2419-2425
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2419 |
} |
2429 |
} |
2420 |
|
2430 |
|
2421 |
if (badFlag || stApp == eBad || stAppVersion == eBad || |
2431 |
if (badFlag || stApp == eBad || stAppVersion == eBad || |
2422 |
stOs == eBad || stOsVersion == eBad) |
2432 |
stOs == eBad || stOsVersion == eBad || stDesktop == eBad) |
2423 |
continue; |
2433 |
continue; |
2424 |
|
2434 |
|
2425 |
nsCOMPtr<nsIURI> resolved; |
2435 |
nsCOMPtr<nsIURI> resolved; |
Lines 2460-2465
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2460 |
TriState stApp = eUnspecified; |
2470 |
TriState stApp = eUnspecified; |
2461 |
TriState stOs = eUnspecified; |
2471 |
TriState stOs = eUnspecified; |
2462 |
TriState stOsVersion = eUnspecified; |
2472 |
TriState stOsVersion = eUnspecified; |
|
|
2473 |
TriState stDesktop = eUnspecified; |
2463 |
|
2474 |
|
2464 |
PRBool badFlag = PR_FALSE; |
2475 |
PRBool badFlag = PR_FALSE; |
2465 |
|
2476 |
|
Lines 2470-2475
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2470 |
|
2481 |
|
2471 |
if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
2482 |
if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
2472 |
CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
2483 |
CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
|
2484 |
CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
2473 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
2485 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
2474 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
2486 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
2475 |
continue; |
2487 |
continue; |
Lines 2481-2487
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2481 |
} |
2493 |
} |
2482 |
|
2494 |
|
2483 |
if (badFlag || stApp == eBad || stAppVersion == eBad || |
2495 |
if (badFlag || stApp == eBad || stAppVersion == eBad || |
2484 |
stOs == eBad || stOsVersion == eBad) |
2496 |
stOs == eBad || stOsVersion == eBad || stDesktop == eBad) |
2485 |
continue; |
2497 |
continue; |
2486 |
|
2498 |
|
2487 |
nsCOMPtr<nsIURI> resolved; |
2499 |
nsCOMPtr<nsIURI> resolved; |
Lines 2524-2529
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2524 |
TriState stApp = eUnspecified; |
2536 |
TriState stApp = eUnspecified; |
2525 |
TriState stOs = eUnspecified; |
2537 |
TriState stOs = eUnspecified; |
2526 |
TriState stOsVersion = eUnspecified; |
2538 |
TriState stOsVersion = eUnspecified; |
|
|
2539 |
TriState stDesktop = eUnspecified; |
2527 |
|
2540 |
|
2528 |
PRBool badFlag = PR_FALSE; |
2541 |
PRBool badFlag = PR_FALSE; |
2529 |
|
2542 |
|
Lines 2534-2539
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2534 |
|
2547 |
|
2535 |
if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
2548 |
if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
2536 |
CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
2549 |
CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
|
2550 |
CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
2537 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
2551 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
2538 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
2552 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
2539 |
continue; |
2553 |
continue; |
Lines 2545-2551
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2545 |
} |
2559 |
} |
2546 |
|
2560 |
|
2547 |
if (badFlag || stApp == eBad || stAppVersion == eBad || |
2561 |
if (badFlag || stApp == eBad || stAppVersion == eBad || |
2548 |
stOs == eBad || stOsVersion == eBad) |
2562 |
stOs == eBad || stOsVersion == eBad || stDesktop == eBad) |
2549 |
continue; |
2563 |
continue; |
2550 |
|
2564 |
|
2551 |
nsCOMPtr<nsIURI> baseuri, overlayuri; |
2565 |
nsCOMPtr<nsIURI> baseuri, overlayuri; |
Lines 2580-2585
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2580 |
TriState stApp = eUnspecified; |
2594 |
TriState stApp = eUnspecified; |
2581 |
TriState stOs = eUnspecified; |
2595 |
TriState stOs = eUnspecified; |
2582 |
TriState stOsVersion = eUnspecified; |
2596 |
TriState stOsVersion = eUnspecified; |
|
|
2597 |
TriState stDesktop = eUnspecified; |
2583 |
|
2598 |
|
2584 |
PRBool badFlag = PR_FALSE; |
2599 |
PRBool badFlag = PR_FALSE; |
2585 |
|
2600 |
|
Lines 2590-2595
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2590 |
|
2605 |
|
2591 |
if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
2606 |
if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
2592 |
CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
2607 |
CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
|
2608 |
CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
2593 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
2609 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
2594 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
2610 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
2595 |
continue; |
2611 |
continue; |
Lines 2601-2607
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2601 |
} |
2617 |
} |
2602 |
|
2618 |
|
2603 |
if (badFlag || stApp == eBad || stAppVersion == eBad || |
2619 |
if (badFlag || stApp == eBad || stAppVersion == eBad || |
2604 |
stOs == eBad || stOsVersion == eBad) |
2620 |
stOs == eBad || stOsVersion == eBad || stDesktop == eBad) |
2605 |
continue; |
2621 |
continue; |
2606 |
|
2622 |
|
2607 |
nsCOMPtr<nsIURI> baseuri, overlayuri; |
2623 |
nsCOMPtr<nsIURI> baseuri, overlayuri; |
Lines 2640-2645
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2640 |
TriState stApp = eUnspecified; |
2656 |
TriState stApp = eUnspecified; |
2641 |
TriState stOs = eUnspecified; |
2657 |
TriState stOs = eUnspecified; |
2642 |
TriState stOsVersion = eUnspecified; |
2658 |
TriState stOsVersion = eUnspecified; |
|
|
2659 |
TriState stDesktop = eUnspecified; |
2643 |
|
2660 |
|
2644 |
PRBool badFlag = PR_FALSE; |
2661 |
PRBool badFlag = PR_FALSE; |
2645 |
|
2662 |
|
Lines 2650-2655
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2650 |
|
2667 |
|
2651 |
if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
2668 |
if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
2652 |
CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
2669 |
CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
|
2670 |
CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
2653 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
2671 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
2654 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
2672 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
2655 |
continue; |
2673 |
continue; |
Lines 2661-2667
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2661 |
} |
2679 |
} |
2662 |
|
2680 |
|
2663 |
if (badFlag || stApp == eBad || stAppVersion == eBad || |
2681 |
if (badFlag || stApp == eBad || stAppVersion == eBad || |
2664 |
stOs == eBad || stOsVersion == eBad) |
2682 |
stOs == eBad || stOsVersion == eBad || stDesktop == eBad) |
2665 |
continue; |
2683 |
continue; |
2666 |
|
2684 |
|
2667 |
nsCOMPtr<nsIURI> chromeuri, resolveduri; |
2685 |
nsCOMPtr<nsIURI> chromeuri, resolveduri; |
Lines 2702-2707
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2702 |
TriState stApp = eUnspecified; |
2720 |
TriState stApp = eUnspecified; |
2703 |
TriState stOsVersion = eUnspecified; |
2721 |
TriState stOsVersion = eUnspecified; |
2704 |
TriState stOs = eUnspecified; |
2722 |
TriState stOs = eUnspecified; |
|
|
2723 |
TriState stDesktop = eUnspecified; |
2705 |
|
2724 |
|
2706 |
PRBool badFlag = PR_FALSE; |
2725 |
PRBool badFlag = PR_FALSE; |
2707 |
|
2726 |
|
Lines 2712-2717
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2712 |
|
2731 |
|
2713 |
if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
2732 |
if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
2714 |
CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
2733 |
CheckStringFlag(kOs, wtoken, osTarget, stOs) || |
|
|
2734 |
CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
2715 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
2735 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, vc, stOsVersion) || |
2716 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
2736 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, vc, stAppVersion)) |
2717 |
continue; |
2737 |
continue; |
Lines 2723-2729
nsChromeRegistry::ProcessManifestBuffer(
Link Here
|
2723 |
} |
2743 |
} |
2724 |
|
2744 |
|
2725 |
if (badFlag || stApp == eBad || stAppVersion == eBad || |
2745 |
if (badFlag || stApp == eBad || stAppVersion == eBad || |
2726 |
stOs == eBad || stOsVersion == eBad) |
2746 |
stOs == eBad || stOsVersion == eBad || stDesktop == eBad) |
2727 |
continue; |
2747 |
continue; |
2728 |
|
2748 |
|
2729 |
nsDependentCString host(package); |
2749 |
nsDependentCString host(package); |