| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "jingle/notifier/base/gaia_token_pre_xmpp_auth.h" | 5 #include "jingle/notifier/base/gaia_token_pre_xmpp_auth.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 virtual ~GaiaCookieMechanism() {} | 28 virtual ~GaiaCookieMechanism() {} |
| 29 | 29 |
| 30 virtual buzz::XmlElement* StartSaslAuth() { | 30 virtual buzz::XmlElement* StartSaslAuth() { |
| 31 buzz::XmlElement* auth = buzz::SaslCookieMechanism::StartSaslAuth(); | 31 buzz::XmlElement* auth = buzz::SaslCookieMechanism::StartSaslAuth(); |
| 32 // These attributes are necessary for working with non-gmail gaia | 32 // These attributes are necessary for working with non-gmail gaia |
| 33 // accounts. | 33 // accounts. |
| 34 const std::string NS_GOOGLE_AUTH_PROTOCOL( | 34 const std::string NS_GOOGLE_AUTH_PROTOCOL( |
| 35 "http://www.google.com/talk/protocol/auth"); | 35 "http://www.google.com/talk/protocol/auth"); |
| 36 const buzz::QName QN_GOOGLE_ALLOW_GENERATED_JID_XMPP_LOGIN( | 36 const buzz::QName QN_GOOGLE_ALLOW_GENERATED_JID_XMPP_LOGIN( |
| 37 true, NS_GOOGLE_AUTH_PROTOCOL, "allow-generated-jid"); | 37 NS_GOOGLE_AUTH_PROTOCOL, "allow-generated-jid"); |
| 38 const buzz::QName QN_GOOGLE_AUTH_CLIENT_USES_FULL_BIND_RESULT( | 38 const buzz::QName QN_GOOGLE_AUTH_CLIENT_USES_FULL_BIND_RESULT( |
| 39 true, NS_GOOGLE_AUTH_PROTOCOL, "client-uses-full-bind-result"); | 39 NS_GOOGLE_AUTH_PROTOCOL, "client-uses-full-bind-result"); |
| 40 auth->SetAttr(QN_GOOGLE_ALLOW_GENERATED_JID_XMPP_LOGIN, "true"); | 40 auth->SetAttr(QN_GOOGLE_ALLOW_GENERATED_JID_XMPP_LOGIN, "true"); |
| 41 auth->SetAttr(QN_GOOGLE_AUTH_CLIENT_USES_FULL_BIND_RESULT, "true"); | 41 auth->SetAttr(QN_GOOGLE_AUTH_CLIENT_USES_FULL_BIND_RESULT, "true"); |
| 42 return auth; | 42 return auth; |
| 43 } | 43 } |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(GaiaCookieMechanism); | 46 DISALLOW_COPY_AND_ASSIGN(GaiaCookieMechanism); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 } // namespace | 49 } // namespace |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 buzz::SaslMechanism* GaiaTokenPreXmppAuth::CreateSaslMechanism( | 107 buzz::SaslMechanism* GaiaTokenPreXmppAuth::CreateSaslMechanism( |
| 108 const std::string& mechanism) { | 108 const std::string& mechanism) { |
| 109 if (mechanism == auth_mechanism_) | 109 if (mechanism == auth_mechanism_) |
| 110 return new GaiaCookieMechanism( | 110 return new GaiaCookieMechanism( |
| 111 mechanism, username_, token_, token_service_); | 111 mechanism, username_, token_, token_service_); |
| 112 return NULL; | 112 return NULL; |
| 113 } | 113 } |
| 114 | 114 |
| 115 } // namespace notifier | 115 } // namespace notifier |
| OLD | NEW |