| 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 30 matching lines...) Expand all Loading... |
| 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 |
| 50 | 50 |
| 51 // By default use a Google cookie auth mechanism. | |
| 52 const char GaiaTokenPreXmppAuth::kDefaultAuthMechanism[] = "X-GOOGLE-TOKEN"; | |
| 53 | |
| 54 GaiaTokenPreXmppAuth::GaiaTokenPreXmppAuth( | 51 GaiaTokenPreXmppAuth::GaiaTokenPreXmppAuth( |
| 55 const std::string& username, | 52 const std::string& username, |
| 56 const std::string& token, | 53 const std::string& token, |
| 57 const std::string& token_service, | 54 const std::string& token_service, |
| 58 const std::string& auth_mechanism) | 55 const std::string& auth_mechanism) |
| 59 : username_(username), | 56 : username_(username), |
| 60 token_(token), | 57 token_(token), |
| 61 token_service_(token_service), | 58 token_service_(token_service), |
| 62 auth_mechanism_(auth_mechanism) { | 59 auth_mechanism_(auth_mechanism) { |
| 63 DCHECK(!auth_mechanism_.empty()); | 60 DCHECK(!auth_mechanism_.empty()); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 108 |
| 112 buzz::SaslMechanism* GaiaTokenPreXmppAuth::CreateSaslMechanism( | 109 buzz::SaslMechanism* GaiaTokenPreXmppAuth::CreateSaslMechanism( |
| 113 const std::string& mechanism) { | 110 const std::string& mechanism) { |
| 114 if (mechanism == auth_mechanism_) | 111 if (mechanism == auth_mechanism_) |
| 115 return new GaiaCookieMechanism( | 112 return new GaiaCookieMechanism( |
| 116 mechanism, username_, token_, token_service_); | 113 mechanism, username_, token_, token_service_); |
| 117 return NULL; | 114 return NULL; |
| 118 } | 115 } |
| 119 | 116 |
| 120 } // namespace notifier | 117 } // namespace notifier |
| OLD | NEW |