Bug 728813 - Switch Help menu item to allow leaving Safe Mode when it's enabled. r=MattN

This commit is contained in:
Manraj Singh 2015-04-23 12:21:00 -07:00
Родитель 5bbc9a303f
Коммит e4cfa4d611
3 изменённых файлов: 22 добавлений и 0 удалений

Просмотреть файл

@ -81,6 +81,8 @@
<menuitem id="helpSafeMode"
accesskey="&helpSafeMode.accesskey;"
label="&helpSafeMode.label;"
stopaccesskey="&helpSafeMode.stop.accesskey;"
stoplabel="&helpSafeMode.stop.label;"
oncommand="safeModeRestart();"/>
<menuseparator id="aboutSeparator"/>
<menuitem id="aboutName"

Просмотреть файл

@ -1280,6 +1280,12 @@ var gBrowserInit = {
gHomeButton.updateTooltip(homeButton);
gHomeButton.updatePersonalToolbarStyle(homeButton);
let safeMode = document.getElementById("helpSafeMode");
if (Services.appinfo.inSafeMode) {
safeMode.label = safeMode.getAttribute("stoplabel");
safeMode.accesskey = safeMode.getAttribute("stopaccesskey");
}
// BiDi UI
gBidiUI = isBidiEnabled();
if (gBidiUI) {
@ -7531,6 +7537,18 @@ Object.defineProperty(this, "HUDService", {
// Prompt user to restart the browser in safe mode
function safeModeRestart() {
if (Services.appinfo.inSafeMode) {
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
createInstance(Ci.nsISupportsPRBool);
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
if (cancelQuit.data)
return;
Services.startup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit);
return;
}
Services.obs.notifyObservers(null, "restart-in-safe-mode", "");
}

Просмотреть файл

@ -25,6 +25,8 @@
<!ENTITY helpSafeMode.label "Restart with Add-ons Disabled…">
<!ENTITY helpSafeMode.accesskey "R">
<!ENTITY helpSafeMode.stop.label "Restart with Add-ons Enabled">
<!ENTITY helpSafeMode.stop.accesskey "R">
<!ENTITY healthReport2.label "&brandShorterName; Health Report">
<!ENTITY healthReport2.accesskey "e">