Skip to content

Commit 17c3172

Browse files
author
Silaghi
committed
Revert "Bug 2053447: Part 5 - Update for enterprise policies.r=mkaply" for causing bc failures at /browser_suppressTips.js
This reverts commit 4e82cee. Revert "Bug 2053447: Part 4 - Update rest of LaunchOnLogin code to use new API.r=omc-reviewers,firefox-desktop-core-reviewers ,aminomancer" This reverts commit 07e458f. Revert "Bug 2053447: Part 3 - Update Launch on Login pref to use new API.r=tgiles" This reverts commit 9f8a694. Revert "Bug 2053447: Part 2 - Port the existing LaunchOnLogin code.r=hsohaney" This reverts commit 4a2e7ad. Revert "Bug 2053447 - Part 1: Create a LaunchOnLogin interface for macOS. r=hsohaney" This reverts commit 2f90071.
1 parent 4d25de2 commit 17c3172

29 files changed

Lines changed: 178 additions & 513 deletions

‎browser/app/profile/firefox.js‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,8 @@ pref("browser.startup.couldRestoreSession.count", 0);
351351
// users as it is not implemented anywhere else.
352352
#if defined(XP_WIN)
353353
pref("browser.startup.preXulSkeletonUI", true);
354-
#endif
355-
356-
// These are called browser.startup.windowsLaunchOnLogin.* because they originated
357-
// on Windows, but they now operate on macOS as well.
358-
// They can't be changed until there are no experiments running that are using the
359-
// old name - https://bugzilla.mozilla.org/show_bug.cgi?id=2059749
360354

361-
// Whether the checkbox to enable Launch on login is shown
355+
// Whether the checkbox to enable Windows launch on login is shown
362356
pref("browser.startup.windowsLaunchOnLogin.enabled", true);
363357
// Whether to show the launch on login infobar notification
364358
pref("browser.startup.windowsLaunchOnLogin.disableLaunchOnLoginPrompt", false);
@@ -369,6 +363,7 @@ pref("browser.startup.windowsLaunchOnLogin.disableLaunchOnLoginPrompt", false);
369363
// direction.
370364
pref("browser.startup.windowsLaunchOnLogin.defaultEnabled", false);
371365
pref("browser.startup.windowsLaunchOnLogin.alreadyApplied", false);
366+
#endif
372367

373368
// Show an upgrade dialog on major upgrades.
374369
pref("browser.startup.upgradeDialog.enabled", false);

‎browser/base/content/test/performance/browser_startup.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,10 @@ const startupPhases = {
108108
};
109109

110110
if (AppConstants.platform == "win") {
111-
let modules = startupPhases["before profile selection"].allowlist.modules;
112-
// we call checkForLaunchOnLogin early in startup.
113-
modules.add(
111+
// On Windows we call checkForLaunchOnLogin early in startup.
112+
startupPhases["before profile selection"].allowlist.modules.add(
114113
"moz-src:///browser/components/shell/StartupOSIntegration.sys.mjs"
115114
);
116-
modules.add("resource://gre/modules/LaunchOnLogin.sys.mjs");
117115
}
118116

119117
if (

‎browser/components/BrowserComponents.manifest‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ category browser-idle-startup resource:///modules/UpdatePolicyEnforcer.sys.mjs U
186186
#endif
187187
#ifdef XP_WIN
188188
category browser-idle-startup resource:///modules/WindowsJumpLists.sys.mjs WinTaskbarJumpList.startup
189+
category browser-idle-startup resource:///modules/DefaultWindowsLaunchOnLogin.sys.mjs DefaultWindowsLaunchOnLogin.maybeEnableOnFirstRun
189190
#endif
190191
#if defined(XP_WIN) || defined(XP_MACOSX)
191-
category browser-idle-startup resource:///modules/DefaultLaunchOnLogin.sys.mjs DefaultLaunchOnLogin.maybeEnableOnFirstRun
192192
category browser-idle-startup moz-src:///browser/components/shell/StartupOSIntegration.sys.mjs StartupOSIntegration.onStartupIdle
193193
#endif
194194

‎browser/components/StartupTelemetry.sys.mjs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
1212
LoginHelper: "resource://gre/modules/LoginHelper.sys.mjs",
1313
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
1414
OsEnvironment: "resource://gre/modules/OsEnvironment.sys.mjs",
15-
LaunchOnLogin: "resource://gre/modules/LaunchOnLogin.sys.mjs",
15+
WindowsLaunchOnLogin: "resource://gre/modules/WindowsLaunchOnLogin.sys.mjs",
1616
PlacesDBUtils: "resource://gre/modules/PlacesDBUtils.sys.mjs",
1717
ShellService: "moz-src:///browser/components/shell/ShellService.sys.mjs",
1818
TelemetryReportingPolicy:
@@ -481,11 +481,12 @@ export let StartupTelemetry = {
481481

482482
async launchOnLoginState() {
483483
let state;
484-
if (!lazy.LaunchOnLogin.isSupported()) {
484+
if (AppConstants.platform != "win") {
485485
state = "not_supported";
486486
} else {
487487
try {
488-
const enablementDetails = await lazy.LaunchOnLogin.enablementDetails();
488+
const enablementDetails =
489+
await lazy.WindowsLaunchOnLogin.getLaunchOnLoginEnablementDetails();
489490
if (enablementDetails.isEnabled) {
490491
state = "enabled";
491492
} else if (!enablementDetails.isSupported) {

‎browser/components/asrouter/modules/ASRouterTargeting.sys.mjs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
8686
TaskbarTabs: "resource:///modules/taskbartabs/TaskbarTabs.sys.mjs",
8787
TelemetryEnvironment: "resource://gre/modules/TelemetryEnvironment.sys.mjs",
8888
TelemetrySession: "resource://gre/modules/TelemetrySession.sys.mjs",
89-
LaunchOnLogin: "resource://gre/modules/LaunchOnLogin.sys.mjs",
89+
WindowsLaunchOnLogin: "resource://gre/modules/WindowsLaunchOnLogin.sys.mjs",
9090
});
9191

9292
ChromeUtils.defineLazyGetter(lazy, "fxAccounts", () => {
@@ -1190,20 +1190,20 @@ const TargetingGetters = {
11901190
},
11911191

11921192
get launchOnLoginEnabled() {
1193-
if (!lazy.LaunchOnLogin.isSupported()) {
1193+
if (AppConstants.platform !== "win") {
11941194
return false;
11951195
}
1196-
return lazy.LaunchOnLogin.isEnabled();
1196+
return lazy.WindowsLaunchOnLogin.getLaunchOnLoginEnabled();
11971197
},
11981198

11991199
// Whether launch on login could be enabled, i.e. it isn't overridden by
12001200
// Windows Settings or enterprise policy. Used to avoid offering launch on
12011201
// login to users for whom enabling it would silently no-op.
12021202
get launchOnLoginAllowedByPolicy() {
1203-
if (!lazy.LaunchOnLogin.isSupported()) {
1203+
if (AppConstants.platform !== "win") {
12041204
return false;
12051205
}
1206-
return lazy.LaunchOnLogin.isAllowed();
1206+
return lazy.WindowsLaunchOnLogin.getLaunchOnLoginApproved();
12071207
},
12081208

12091209
get isMSIX() {

‎browser/components/defaultlaunchonlogin/tests/xpcshell.toml‎

Lines changed: 0 additions & 9 deletions
This file was deleted.

browser/components/defaultlaunchonlogin/DefaultLaunchOnLogin.sys.mjs renamed to browser/components/defaultwindowslaunchonlogin/DefaultWindowsLaunchOnLogin.sys.mjs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,25 @@
44

55
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
66

7-
// These IDs and preferences contain Windows in their name as legacy
8-
// and changing them to be OS agnostic would break existing installs.
9-
export const DEFAULT_LAUNCH_ON_LOGIN_NIMBUS_FEATURE_ID =
7+
export const DEFAULT_WINDOWS_LAUNCH_ON_LOGIN_NIMBUS_FEATURE_ID =
108
"defaultWindowsLaunchOnLogin";
119

12-
export const DEFAULT_LAUNCH_ON_LOGIN_PREF =
10+
export const DEFAULT_WINDOWS_LAUNCH_ON_LOGIN_PREF =
1311
"browser.startup.windowsLaunchOnLogin.defaultEnabled";
14-
export const DEFAULT_LAUNCH_ON_LOGIN_ALREADY_APPLIED_PREF =
12+
export const DEFAULT_WINDOWS_LAUNCH_ON_LOGIN_ALREADY_APPLIED_PREF =
1513
"browser.startup.windowsLaunchOnLogin.alreadyApplied";
1614

1715
const lazy = XPCOMUtils.declareLazy({
1816
AppConstants: "resource://gre/modules/AppConstants.sys.mjs",
1917
ExperimentAPI: "resource://nimbus/ExperimentAPI.sys.mjs",
20-
LaunchOnLogin: "resource://gre/modules/LaunchOnLogin.sys.mjs",
18+
WindowsLaunchOnLogin: "resource://gre/modules/WindowsLaunchOnLogin.sys.mjs",
2119
profileService: {
2220
service: "@mozilla.org/toolkit/profile-service;1",
2321
iid: Ci.nsIToolkitProfileService,
2422
},
2523
});
2624

27-
export var DefaultLaunchOnLogin = {
25+
export var DefaultWindowsLaunchOnLogin = {
2826
/**
2927
* `browser-idle-startup` category entry point.
3028
*
@@ -46,7 +44,7 @@ export var DefaultLaunchOnLogin = {
4644
let isFirstRun = lazy.profileService.isFirstRun;
4745
let isOfficialBuild = lazy.AppConstants.MOZILLA_OFFICIAL;
4846
let alreadyApplied = Services.prefs.getBoolPref(
49-
DEFAULT_LAUNCH_ON_LOGIN_ALREADY_APPLIED_PREF,
47+
DEFAULT_WINDOWS_LAUNCH_ON_LOGIN_ALREADY_APPLIED_PREF,
5048
false
5149
);
5250

@@ -57,7 +55,6 @@ export var DefaultLaunchOnLogin = {
5755
) {
5856
isFirstRun = true;
5957
isOfficialBuild = true;
60-
alreadyApplied = false;
6158
}
6259

6360
await this.enableOnFirstRunIfNeeded(
@@ -82,7 +79,7 @@ export var DefaultLaunchOnLogin = {
8279
*/
8380
async enableOnFirstRunIfNeeded(isFirstRun, isOfficialBuild, alreadyApplied) {
8481
if (
85-
!lazy.LaunchOnLogin.isSupported() ||
82+
lazy.AppConstants.platform !== "win" ||
8683
!isOfficialBuild ||
8784
!isFirstRun ||
8885
alreadyApplied
@@ -94,21 +91,23 @@ export var DefaultLaunchOnLogin = {
9491
// applied its value before we read the pref below.
9592
await this.waitForNimbusReady();
9693

97-
if (!Services.prefs.getBoolPref(DEFAULT_LAUNCH_ON_LOGIN_PREF, false)) {
94+
if (
95+
!Services.prefs.getBoolPref(DEFAULT_WINDOWS_LAUNCH_ON_LOGIN_PREF, false)
96+
) {
9897
return;
9998
}
10099

101100
// Mark the launch on login as applied so we don't do it again
102101
Services.prefs.setBoolPref(
103-
DEFAULT_LAUNCH_ON_LOGIN_ALREADY_APPLIED_PREF,
102+
DEFAULT_WINDOWS_LAUNCH_ON_LOGIN_ALREADY_APPLIED_PREF,
104103
true
105104
);
106105

107-
if (!(await lazy.LaunchOnLogin.isAllowed())) {
106+
if (!(await lazy.WindowsLaunchOnLogin.getLaunchOnLoginApproved())) {
108107
return;
109108
}
110109

111-
await lazy.LaunchOnLogin.enable();
110+
await lazy.WindowsLaunchOnLogin.createLaunchOnLogin();
112111
},
113112

114113
/**

browser/components/defaultlaunchonlogin/moz.build renamed to browser/components/defaultwindowslaunchonlogin/moz.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ with Files("**"):
66
BUG_COMPONENT = ("Firefox", "Shell Integration")
77

88
EXTRA_JS_MODULES += [
9-
"DefaultLaunchOnLogin.sys.mjs",
9+
"DefaultWindowsLaunchOnLogin.sys.mjs",
1010
]
1111

1212
XPCSHELL_TESTS_MANIFESTS += ["tests/xpcshell.toml"]

0 commit comments

Comments
 (0)