[gnome-shell/wip/wayland-gdm-cleanup: 19/19] gdm: Make the smartcard and service status fields private



commit f7055b8fa2d3db782f39c4dc23a169423dd66a78
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Mar 7 19:16:24 2014 -0500

    gdm: Make the smartcard and service status fields private
    
    We don't need to export these publicly any more.

 js/gdm/authPrompt.js |    6 ------
 js/gdm/util.js       |   36 +++++++++++++++++-------------------
 2 files changed, 17 insertions(+), 25 deletions(-)
---
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index fb85004..d6c7653 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -44,8 +44,6 @@ const AuthPrompt = new Lang.Class({
         this._userVerifier.connect('show-message', Lang.bind(this, this._onShowMessage));
         this._userVerifier.connect('verification-failed', Lang.bind(this, this._onVerificationFailed));
         this._userVerifier.connect('reset', Lang.bind(this, this._onReset));
-        this._userVerifier.connect('smartcard-status-changed', Lang.bind(this, 
this._onSmartcardStatusChanged));
-        this.smartcardDetected = this._userVerifier.smartcardDetected;
 
         this.connect('next', Lang.bind(this, function() {
                          this.updateSensitivity(false);
@@ -218,10 +216,6 @@ const AuthPrompt = new Lang.Class({
         this.emit('prompted');
     },
 
-    _onSmartcardStatusChanged: function() {
-        this.smartcardDetected = this._userVerifier.smartcardDetected;
-    },
-
     _onShowMessage: function(userVerifier, message, type) {
         this.setMessage(message, type);
         this.emit('prompted');
diff --git a/js/gdm/util.js b/js/gdm/util.js
index e939c39..de781dc 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -183,9 +183,9 @@ const ShellUserVerifier = new Lang.Class({
             // The user is constant at the unlock screen, so it will immediately
             // respond to the request with the username
             needsUsername = true;
-        } else if (this.serviceIsForeground(GdmUtil.OVIRT_SERVICE_NAME) ||
-                   (this.smartcardDetected &&
-                    this.serviceIsForeground(GdmUtil.SMARTCARD_SERVICE_NAME))) {
+        } else if (this._serviceIsForeground(GdmUtil.OVIRT_SERVICE_NAME) ||
+                   (this._smartcardDetected &&
+                    this._serviceIsForeground(GdmUtil.SMARTCARD_SERVICE_NAME))) {
             // We don't need to know the username if the user preempted the login screen
             // with a smartcard or with preauthenticated oVirt credentials
             needsUsername = false;
@@ -342,10 +342,10 @@ const ShellUserVerifier = new Lang.Class({
         else
             smartcardDetected = this._smartcardManager.hasInsertedTokens();
 
-        if (this.smartcardDetected == smartcardDetected)
+        if (this._smartcardDetected == smartcardDetected)
             return;
 
-        this.smartcardDetected = smartcardDetected;
+        this._smartcardDetected = smartcardDetected;
 
         // Most of the time we want to reset if the user inserts or removes
         // a smartcard. Smartcard insertion "preempts" what the user was
@@ -356,13 +356,11 @@ const ShellUserVerifier = new Lang.Class({
         //                        the user is getting logged in.
         if (this._serviceIsDefault(SMARTCARD_SERVICE_NAME) &&
             this.verificationStatus == VerificationStatus.VERIFYING &&
-            this.smartcardDetected)
+            this._smartcardDetected)
             return;
 
         if (this.verificationStatus != VerificationStatus.VERIFICATION_SUCCEEDED)
             this._reset();
-
-        this.emit('smartcard-status-changed');
     },
 
     _reportInitError: function(where, error) {
@@ -421,24 +419,24 @@ const ShellUserVerifier = new Lang.Class({
     _getForegroundService: function() {
         if (this._oVirtCredentialsManager.hasToken())
             return OVIRT_SERVICE_NAME;
-        if (this.smartcardDetected)
+        if (this._smartcardDetected)
             return SMARTCARD_SERVICE_NAME;
 
         return this._defaultService;
     },
 
-    serviceIsForeground: function(serviceName) {
+    _serviceIsForeground: function(serviceName) {
         return serviceName == this._getForegroundService();
     },
 
-    serviceIsDefault: function(serviceName) {
+    _serviceIsDefault: function(serviceName) {
         return serviceName == this._defaultService;
     },
 
     _updateDefaultService: function() {
         if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
             this._defaultService = PASSWORD_SERVICE_NAME;
-        else if (this.smartcardDetected)
+        else if (this._smartcardDetected)
             this._defaultService = SMARTCARD_SERVICE_NAME;
         else if (this._haveFingerprintReader)
             this._defaultService = FINGERPRINT_SERVICE_NAME;
@@ -478,12 +476,12 @@ const ShellUserVerifier = new Lang.Class({
     _beginVerification: function() {
         this._startService(this._getForegroundService());
 
-        if (this._userName && this._haveFingerprintReader && 
!this.serviceIsForeground(FINGERPRINT_SERVICE_NAME))
+        if (this._userName && this._haveFingerprintReader && 
!this._serviceIsForeground(FINGERPRINT_SERVICE_NAME))
             this._startService(FINGERPRINT_SERVICE_NAME);
     },
 
     _onInfo: function(client, serviceName, info) {
-        if (this.serviceIsForeground(serviceName)) {
+        if (this._serviceIsForeground(serviceName)) {
             this._queueMessage(info, MessageType.INFO);
         } else if (serviceName == FINGERPRINT_SERVICE_NAME &&
             this._haveFingerprintReader) {
@@ -498,21 +496,21 @@ const ShellUserVerifier = new Lang.Class({
     },
 
     _onProblem: function(client, serviceName, problem) {
-        if (!this.serviceIsForeground(serviceName))
+        if (!this._serviceIsForeground(serviceName))
             return;
 
         this._queueMessage(problem, MessageType.ERROR);
     },
 
     _onInfoQuery: function(client, serviceName, question) {
-        if (!this.serviceIsForeground(serviceName))
+        if (!this._serviceIsForeground(serviceName))
             return;
 
         this.emit('ask-question', serviceName, question, '');
     },
 
     _onSecretInfoQuery: function(client, serviceName, secretQuestion) {
-        if (!this.serviceIsForeground(serviceName))
+        if (!this._serviceIsForeground(serviceName))
             return;
 
         if (serviceName == OVIRT_SERVICE_NAME) {
@@ -557,7 +555,7 @@ const ShellUserVerifier = new Lang.Class({
         // If the login failed with the preauthenticated oVirt credentials
         // then discard the credentials and revert to default authentication
         // mechanism.
-        if (this.serviceIsForeground(OVIRT_SERVICE_NAME)) {
+        if (this._serviceIsForeground(OVIRT_SERVICE_NAME)) {
             this._oVirtCredentialsManager.resetToken();
             this._verificationFailed(false);
             return;
@@ -566,7 +564,7 @@ const ShellUserVerifier = new Lang.Class({
         // if the password service fails, then cancel everything.
         // But if, e.g., fingerprint fails, still give
         // password authentication a chance to succeed
-        if (this.serviceIsForeground(serviceName)) {
+        if (this._serviceIsForeground(serviceName)) {
             this._verificationFailed(true);
         }
     },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]