Pier Angelo Vendrame pushed to branch mullvad-browser-128.4.0esr-14.5-1 at The Tor Project / Applications / Mullvad Browser

Commits:

2 changed files:

Changes:

  • toolkit/xre/ProfileReset.cpp
    ... ... @@ -23,8 +23,8 @@
    23 23
     
    
    24 24
     using namespace mozilla;
    
    25 25
     
    
    26
    -extern const XREAppData* gAppData;
    
    27
    -
    
    26
    +static const char kBrandProperties[] =
    
    27
    +    "chrome://branding/locale/brand.properties";
    
    28 28
     static const char kProfileProperties[] =
    
    29 29
         "chrome://mozapps/locale/profile/profileSelection.properties";
    
    30 30
     
    
    ... ... @@ -49,12 +49,21 @@ nsresult ProfileResetCleanup(nsToolkitProfileService* aService,
    49 49
           mozilla::components::StringBundle::Service();
    
    50 50
       if (!sbs) return NS_ERROR_FAILURE;
    
    51 51
     
    
    52
    +  nsCOMPtr<nsIStringBundle> brandBundle;
    
    53
    +  Unused << sbs->CreateBundle(kBrandProperties, getter_AddRefs(brandBundle));
    
    54
    +  if (!brandBundle) return NS_ERROR_FAILURE;
    
    55
    +
    
    52 56
       nsCOMPtr<nsIStringBundle> sb;
    
    53 57
       Unused << sbs->CreateBundle(kProfileProperties, getter_AddRefs(sb));
    
    54 58
       if (!sb) return NS_ERROR_FAILURE;
    
    55 59
     
    
    56
    -  NS_ConvertUTF8toUTF16 appName(gAppData->name);
    
    57
    -  AutoTArray<nsString, 2> params = {appName, appName};
    
    60
    +  nsAutoString appName;
    
    61
    +  rv = brandBundle->GetStringFromName("brandShortName", appName);
    
    62
    +  if (NS_FAILED(rv)) return rv;
    
    63
    +
    
    64
    +  AutoTArray<nsString, 2> params;
    
    65
    +  params.AppendElement(appName);
    
    66
    +  params.AppendElement(appName);
    
    58 67
     
    
    59 68
       nsAutoString resetBackupDirectoryName;
    
    60 69
     
    

  • toolkit/xre/nsAppRunner.cpp
    ... ... @@ -2597,6 +2597,8 @@ nsresult LaunchChild(bool aBlankCommandLine, bool aTryExec) {
    2597 2597
       return NS_ERROR_LAUNCHED_CHILD_PROCESS;
    
    2598 2598
     }
    
    2599 2599
     
    
    2600
    +static const char kBrandProperties[] =
    
    2601
    +    "chrome://branding/locale/brand.properties";
    
    2600 2602
     static const char kProfileProperties[] =
    
    2601 2603
         "chrome://mozapps/locale/profile/profileSelection.properties";
    
    2602 2604
     
    
    ... ... @@ -2666,12 +2668,20 @@ static nsresult ProfileMissingDialog(nsINativeAppSupport* aNative) {
    2666 2668
             mozilla::components::StringBundle::Service();
    
    2667 2669
         NS_ENSURE_TRUE(sbs, NS_ERROR_FAILURE);
    
    2668 2670
     
    
    2671
    +    nsCOMPtr<nsIStringBundle> brandBundle;
    
    2672
    +    sbs->CreateBundle(kBrandProperties, getter_AddRefs(brandBundle));
    
    2673
    +    NS_ENSURE_TRUE_LOG(sbs, NS_ERROR_FAILURE);
    
    2669 2674
         nsCOMPtr<nsIStringBundle> sb;
    
    2670 2675
         sbs->CreateBundle(kProfileProperties, getter_AddRefs(sb));
    
    2671 2676
         NS_ENSURE_TRUE_LOG(sbs, NS_ERROR_FAILURE);
    
    2672 2677
     
    
    2673
    -    NS_ConvertUTF8toUTF16 appName(gAppData->name);
    
    2674
    -    AutoTArray<nsString, 2> params = {appName, appName};
    
    2678
    +    nsAutoString appName;
    
    2679
    +    rv = brandBundle->GetStringFromName("brandShortName", appName);
    
    2680
    +    NS_ENSURE_SUCCESS(rv, NS_ERROR_ABORT);
    
    2681
    +
    
    2682
    +    AutoTArray<nsString, 2> params;
    
    2683
    +    params.AppendElement(appName);
    
    2684
    +    params.AppendElement(appName);
    
    2675 2685
     
    
    2676 2686
         // profileMissing
    
    2677 2687
         nsAutoString missingMessage;
    
    ... ... @@ -2733,12 +2743,21 @@ static ReturnAbortOnError ProfileLockedDialog(nsIFile* aProfileDir,
    2733 2743
             mozilla::components::StringBundle::Service();
    
    2734 2744
         NS_ENSURE_TRUE(sbs, NS_ERROR_FAILURE);
    
    2735 2745
     
    
    2746
    +    nsCOMPtr<nsIStringBundle> brandBundle;
    
    2747
    +    sbs->CreateBundle(kBrandProperties, getter_AddRefs(brandBundle));
    
    2748
    +    NS_ENSURE_TRUE_LOG(sbs, NS_ERROR_FAILURE);
    
    2736 2749
         nsCOMPtr<nsIStringBundle> sb;
    
    2737 2750
         sbs->CreateBundle(kProfileProperties, getter_AddRefs(sb));
    
    2738 2751
         NS_ENSURE_TRUE_LOG(sbs, NS_ERROR_FAILURE);
    
    2739 2752
     
    
    2740
    -    NS_ConvertUTF8toUTF16 appName(gAppData->name);
    
    2741
    -    AutoTArray<nsString, 3> params = {appName, appName, appName};
    
    2753
    +    nsAutoString appName;
    
    2754
    +    rv = brandBundle->GetStringFromName("brandShortName", appName);
    
    2755
    +    NS_ENSURE_SUCCESS(rv, NS_ERROR_ABORT);
    
    2756
    +
    
    2757
    +    AutoTArray<nsString, 3> params;
    
    2758
    +    params.AppendElement(appName);
    
    2759
    +    params.AppendElement(appName);
    
    2760
    +    params.AppendElement(appName);
    
    2742 2761
     
    
    2743 2762
         nsAutoString killMessage;
    
    2744 2763
     #ifndef XP_MACOSX