Bug 1060424 Escape should abort the profile unlock r=bsmedberg

This commit is contained in:
Neil Rashbrook 2014-09-03 21:47:24 +01:00
parent b21e2bff7c
commit 3f8ed79ff5

View File

@ -1794,15 +1794,14 @@ ProfileLockedDialog(nsIFile* aProfileDir, nsIFile* aProfileLocalDir,
nsXPIDLString killMessage;
#ifndef XP_MACOSX
static const char16_t kRestartNoUnlocker[] = {'r','e','s','t','a','r','t','M','e','s','s','a','g','e','N','o','U','n','l','o','c','k','e','r','\0'}; // "restartMessageNoUnlocker"
static const char16_t kRestartUnlocker[] = {'r','e','s','t','a','r','t','M','e','s','s','a','g','e','U','n','l','o','c','k','e','r','\0'}; // "restartMessageUnlocker"
#else
static const char16_t kRestartNoUnlocker[] = {'r','e','s','t','a','r','t','M','e','s','s','a','g','e','N','o','U','n','l','o','c','k','e','r','M','a','c','\0'}; // "restartMessageNoUnlockerMac"
static const char16_t kRestartUnlocker[] = {'r','e','s','t','a','r','t','M','e','s','s','a','g','e','U','n','l','o','c','k','e','r','M','a','c','\0'}; // "restartMessageUnlockerMac"
#endif
sb->FormatStringFromName(aUnlocker ? kRestartUnlocker : kRestartNoUnlocker,
sb->FormatStringFromName(aUnlocker ? MOZ_UTF16("restartMessageUnlocker")
: MOZ_UTF16("restartMessageNoUnlocker"),
params, 2, getter_Copies(killMessage));
#else
sb->FormatStringFromName(aUnlocker ? MOZ_UTF16("restartMessageUnlockerMac")
: MOZ_UTF16("restartMessageNoUnlockerMac"),
params, 2, getter_Copies(killMessage));
#endif
nsXPIDLString killTitle;
sb->FormatStringFromName(MOZ_UTF16("restartTitle"),
@ -1819,23 +1818,22 @@ ProfileLockedDialog(nsIFile* aProfileDir, nsIFile* aProfileLocalDir,
int32_t button;
#ifdef MOZ_WIDGET_ANDROID
mozilla::widget::android::GeckoAppShell::KillAnyZombies();
button = 1;
button = 0;
#else
const uint32_t flags =
(nsIPromptService::BUTTON_TITLE_CANCEL *
nsIPromptService::BUTTON_POS_0) +
(nsIPromptService::BUTTON_TITLE_IS_STRING *
nsIPromptService::BUTTON_POS_1) +
nsIPromptService::BUTTON_POS_1_DEFAULT;
nsIPromptService::BUTTON_POS_0) +
(nsIPromptService::BUTTON_TITLE_CANCEL *
nsIPromptService::BUTTON_POS_1);
bool checkState = false;
rv = ps->ConfirmEx(nullptr, killTitle, killMessage, flags,
nullptr, killTitle, nullptr, nullptr,
killTitle, nullptr, nullptr, nullptr,
&checkState, &button);
NS_ENSURE_SUCCESS_LOG(rv, rv);
#endif
if (button == 1) {
if (button == 0) {
rv = aUnlocker->Unlock(nsIProfileUnlocker::FORCE_QUIT);
if (NS_FAILED(rv)) {
return rv;
@ -1890,8 +1888,7 @@ ProfileMissingDialog(nsINativeAppSupport* aNative)
nsXPIDLString missingMessage;
// profileMissing
static const char16_t kMissing[] = {'p','r','o','f','i','l','e','M','i','s','s','i','n','g','\0'};
sb->FormatStringFromName(kMissing, params, 2, getter_Copies(missingMessage));
sb->FormatStringFromName(MOZ_UTF16("profileMissing"), params, 2, getter_Copies(missingMessage));
nsXPIDLString missingTitle;
sb->FormatStringFromName(MOZ_UTF16("profileMissingTitle"),