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

Side by Side Diff: jingle/notifier/base/gaia_token_pre_xmpp_auth.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 std::string GaiaTokenPreXmppAuth::GetAuthToken() const { 94 std::string GaiaTokenPreXmppAuth::GetAuthToken() const {
95 return token_; 95 return token_;
96 } 96 }
97 97
98 std::string GaiaTokenPreXmppAuth::GetAuthMechanism() const { 98 std::string GaiaTokenPreXmppAuth::GetAuthMechanism() const {
99 return auth_mechanism_; 99 return auth_mechanism_;
100 } 100 }
101 101
102 std::string GaiaTokenPreXmppAuth::ChooseBestSaslMechanism( 102 std::string GaiaTokenPreXmppAuth::ChooseBestSaslMechanism(
103 const std::vector<std::string> & mechanisms, bool encrypted) { 103 const std::vector<std::string> & mechanisms, bool encrypted) {
104 return (std::find(mechanisms.begin(), 104 return (std::find(mechanisms.begin(), mechanisms.end(), auth_mechanism_) !=
105 mechanisms.end(), auth_mechanism_) != 105 mechanisms.end())
106 mechanisms.end()) ? auth_mechanism_ : ""; 106 ? auth_mechanism_
107 : std::string();
107 } 108 }
108 109
109 buzz::SaslMechanism* GaiaTokenPreXmppAuth::CreateSaslMechanism( 110 buzz::SaslMechanism* GaiaTokenPreXmppAuth::CreateSaslMechanism(
110 const std::string& mechanism) { 111 const std::string& mechanism) {
111 if (mechanism == auth_mechanism_) 112 if (mechanism == auth_mechanism_)
112 return new GaiaCookieMechanism( 113 return new GaiaCookieMechanism(
113 mechanism, username_, token_, token_service_); 114 mechanism, username_, token_, token_service_);
114 return NULL; 115 return NULL;
115 } 116 }
116 117
117 } // namespace notifier 118 } // namespace notifier
OLDNEW
« no previous file with comments | « jingle/glue/channel_socket_adapter_unittest.cc ('k') | jingle/notifier/communicator/single_login_attempt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698