Fix bug 308356: fix saving keychain info by making sure we map return codes correctly. r=pinkerton

This commit is contained in:
smfr%smfr.org 2005-09-13 19:55:22 +00:00
parent 35149ea17d
commit 2f5d487548

View File

@ -391,9 +391,16 @@ int KeychainPrefChangedCallback(const char* inPref, void* unused)
int result = [NSApp runModalForWindow:confirmStorePasswordPanel relativeToWindow:parent];
[confirmStorePasswordPanel close];
// the results of hitButtonXX: map to the corresponding values in the
// |KeychainPromptResult| enum so we can just cast and return
return NS_STATIC_CAST(KeychainPromptResult, result);
KeychainPromptResult keychainAction = kDontRemember;
switch (result)
{
case NSAlertDefaultReturn: keychainAction = kSave; break;
default:
case NSAlertAlternateReturn: keychainAction = kDontRemember; break;
case NSAlertOtherReturn: keychainAction = kNeverRemember; break;
}
return keychainAction;
}
//