Bug 1493202: Don't store offline startup state in nsIToolkitProfileService. r=florian

Differential Revision: https://phabricator.services.mozilla.com/D6503

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dave Townsend 2018-09-21 16:50:02 +00:00
parent fb9c5e11eb
commit 9136559bb3
4 changed files with 8 additions and 23 deletions

View File

@ -98,6 +98,8 @@ function acceptDialog() {
updateStartupPrefs();
gDialogParams.SetInt(0, 1);
/* Bug 257777 */
gDialogParams.SetInt(1, document.getElementById("offlineState").checked ? 1 : 0);
gDialogParams.SetString(0, selectedProfile.profile.name);
@ -113,9 +115,6 @@ function exitDialog() {
function updateStartupPrefs() {
var autoSelectLastProfile = document.getElementById("autoSelectLastProfile");
gProfileService.startWithLastProfile = autoSelectLastProfile.checked;
/* Bug 257777 */
gProfileService.startOffline = document.getElementById("offlineState").checked;
}
// handle key event on listboxes

View File

@ -14,7 +14,6 @@ interface nsIProfileLock;
interface nsIToolkitProfileService : nsISupports
{
attribute boolean startWithLastProfile;
attribute boolean startOffline;
readonly attribute nsISimpleEnumerator /*nsIToolkitProfile*/ profiles;

View File

@ -119,8 +119,7 @@ private:
friend nsresult NS_NewToolkitProfileService(nsIToolkitProfileService**);
nsToolkitProfileService() :
mStartWithLast(true),
mStartOffline(false)
mStartWithLast(true)
{
gService = this;
}
@ -140,7 +139,6 @@ private:
nsCOMPtr<nsIFile> mTempData;
nsCOMPtr<nsIFile> mListFile;
bool mStartWithLast;
bool mStartOffline;
static nsToolkitProfileService *gService;
@ -573,20 +571,6 @@ nsToolkitProfileService::GetStartWithLastProfile(bool *aResult)
return NS_OK;
}
NS_IMETHODIMP
nsToolkitProfileService::GetStartOffline(bool *aResult)
{
*aResult = mStartOffline;
return NS_OK;
}
NS_IMETHODIMP
nsToolkitProfileService::SetStartOffline(bool aValue)
{
mStartOffline = aValue;
return NS_OK;
}
NS_IMETHODIMP
nsToolkitProfileService::GetProfiles(nsISimpleEnumerator* *aResult)
{

View File

@ -2119,6 +2119,7 @@ ShowProfileManager(nsIToolkitProfileService* aProfileSvc,
nsCOMPtr<nsIFile> profD, profLD;
char16_t* profileNamePtr;
nsAutoCString profileName;
bool offline = false;
{
ScopedXPCOMStartup xpcom;
@ -2172,6 +2173,10 @@ ShowProfileManager(nsIToolkitProfileService* aProfileSvc,
rv = ioParamBlock->GetInt(0, &dialogConfirmed);
if (NS_FAILED(rv) || dialogConfirmed == 0) return NS_ERROR_ABORT;
int32_t startOffline;
rv = ioParamBlock->GetInt(1, &startOffline);
offline = NS_SUCCEEDED(rv) && startOffline == 1;
nsCOMPtr<nsIProfileLock> lock;
rv = dlgArray->QueryElementAt(0, NS_GET_IID(nsIProfileLock),
getter_AddRefs(lock));
@ -2197,8 +2202,6 @@ ShowProfileManager(nsIToolkitProfileService* aProfileSvc,
SaveFileToEnv("XRE_PROFILE_LOCAL_PATH", profLD);
SaveWordToEnv("XRE_PROFILE_NAME", profileName);
bool offline = false;
aProfileSvc->GetStartOffline(&offline);
if (offline) {
SaveToEnv("XRE_START_OFFLINE=1");
}