gdm: Replace preemptingService with checks in getForegroundService

This removes a piece of the chicken-wire state machine to determine
what the current foreground service should be.
This commit is contained in:
Jasper St. Pierre 2014-03-07 15:31:13 -05:00
parent 8173110842
commit 5eb377bd3b

View File

@ -288,8 +288,7 @@ const ShellUserVerifier = new Lang.Class({
})); }));
}, },
_oVirtUserAuthenticated: function(token) { _oVirtUserAuthenticated: function() {
this._preemptingService = OVIRT_SERVICE_NAME;
this.emit('ovirt-user-authenticated'); this.emit('ovirt-user-authenticated');
}, },
@ -305,12 +304,6 @@ const ShellUserVerifier = new Lang.Class({
if (smartcardDetected != this.smartcardDetected) { if (smartcardDetected != this.smartcardDetected) {
this.smartcardDetected = smartcardDetected; this.smartcardDetected = smartcardDetected;
if (this.smartcardDetected)
this._preemptingService = SMARTCARD_SERVICE_NAME;
else if (this._preemptingService == SMARTCARD_SERVICE_NAME)
this._preemptingService = null;
this.emit('smartcard-status-changed'); this.emit('smartcard-status-changed');
} }
}, },
@ -372,8 +365,10 @@ const ShellUserVerifier = new Lang.Class({
}, },
_getForegroundService: function() { _getForegroundService: function() {
if (this._preemptingService) if (this._oVirtCredentialsManager.hasToken())
return this._preemptingService; return OVIRT_SERVICE_NAME;
if (this.smartcardDetected)
return SMARTCARD_SERVICE_NAME;
return this._defaultService; return this._defaultService;
}, },
@ -542,7 +537,6 @@ const ShellUserVerifier = new Lang.Class({
// mechanism. // mechanism.
if (this.serviceIsForeground(OVIRT_SERVICE_NAME)) { if (this.serviceIsForeground(OVIRT_SERVICE_NAME)) {
this._oVirtCredentialsManager.resetToken(); this._oVirtCredentialsManager.resetToken();
this._preemptingService = null;
this._verificationFailed(false); this._verificationFailed(false);
return; return;
} }