Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Unified Diff: remoting/host/user_authenticator_mac.cc

Issue 6780014: Clean up remoting project (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: got rid of ref counting on user authenticator Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/user_authenticator_mac.h ('k') | remoting/host/user_authenticator_pam.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/user_authenticator_mac.cc
diff --git a/remoting/host/user_authenticator_mac.cc b/remoting/host/user_authenticator_mac.cc
index dd44b06604f1d86d4a1b9aacba2aad8e8ee93f4e..88c095147be797c0f3dd2d836e3fc1849d1e005f 100644
--- a/remoting/host/user_authenticator_mac.cc
+++ b/remoting/host/user_authenticator_mac.cc
@@ -2,23 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/user_authenticator_mac.h"
+#include "remoting/host/user_authenticator.h"
#include <Security/Security.h>
#include <string>
+#include "base/basictypes.h"
#include "base/logging.h"
namespace remoting {
-static const char kAuthorizationRightName[] = "system.login.tty";
+namespace {
-UserAuthenticatorMac::UserAuthenticatorMac() {
-}
+class UserAuthenticatorMac : public UserAuthenticator {
+ public:
+ UserAuthenticatorMac() {}
+ virtual ~UserAuthenticatorMac() {}
+ virtual bool Authenticate(const std::string& username,
+ const std::string& password);
-UserAuthenticatorMac::~UserAuthenticatorMac() {
-}
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UserAuthenticatorMac);
+};
+
+const char kAuthorizationRightName[] = "system.login.tty";
bool UserAuthenticatorMac::Authenticate(const std::string& username,
const std::string& password) {
@@ -33,6 +41,7 @@ bool UserAuthenticatorMac::Authenticate(const std::string& username,
AuthorizationRights rights;
rights.count = 1;
rights.items = &right;
+
// Passing the username/password as an "environment" parameter causes these
// to be submitted to the Security Framework, instead of the interactive
// password prompt appearing on the host system. Valid on OS X 10.4 and
@@ -66,6 +75,8 @@ bool UserAuthenticatorMac::Authenticate(const std::string& username,
}
}
+} // namespace
+
// static
UserAuthenticator* UserAuthenticator::Create() {
return new UserAuthenticatorMac();
« no previous file with comments | « remoting/host/user_authenticator_mac.h ('k') | remoting/host/user_authenticator_pam.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698