OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "google_apis/gaia/gaia_auth_util.h" | 5 #include "google_apis/gaia/gaia_auth_util.h" |
6 | 6 |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 std::string email = CanonicalizeEmail(email_address); | 79 std::string email = CanonicalizeEmail(email_address); |
80 size_t separator_pos = email.find('@'); | 80 size_t separator_pos = email.find('@'); |
81 if (separator_pos != email.npos && separator_pos < email.length() - 1) | 81 if (separator_pos != email.npos && separator_pos < email.length() - 1) |
82 return email.substr(separator_pos + 1); | 82 return email.substr(separator_pos + 1); |
83 else | 83 else |
84 NOTREACHED() << "Not a proper email address: " << email; | 84 NOTREACHED() << "Not a proper email address: " << email; |
85 return std::string(); | 85 return std::string(); |
86 } | 86 } |
87 | 87 |
88 bool IsGaiaSignonRealm(const GURL& url) { | 88 bool IsGaiaSignonRealm(const GURL& url) { |
89 if (!url.SchemeIsSecure()) | 89 if (!url.SchemeIsCryptographic()) |
90 return false; | 90 return false; |
91 | 91 |
92 return url == GaiaUrls::GetInstance()->gaia_url(); | 92 return url == GaiaUrls::GetInstance()->gaia_url(); |
93 } | 93 } |
94 | 94 |
95 | 95 |
96 bool ParseListAccountsData( | 96 bool ParseListAccountsData( |
97 const std::string& data, | 97 const std::string& data, |
98 std::vector<std::pair<std::string, bool> >* accounts) { | 98 std::vector<std::pair<std::string, bool> >* accounts) { |
99 accounts->clear(); | 99 accounts->clear(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 accounts->push_back( | 131 accounts->push_back( |
132 std::make_pair(CanonicalizeEmail(email), is_email_valid != 0)); | 132 std::make_pair(CanonicalizeEmail(email), is_email_valid != 0)); |
133 } | 133 } |
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 return true; | 137 return true; |
138 } | 138 } |
139 | 139 |
140 } // namespace gaia | 140 } // namespace gaia |
OLD | NEW |