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 #ifndef GOOGLE_APIS_GAIA_GAIA_AUTH_UTIL_H_ | 5 #ifndef GOOGLE_APIS_GAIA_GAIA_AUTH_UTIL_H_ |
6 #define GOOGLE_APIS_GAIA_GAIA_AUTH_UTIL_H_ | 6 #define GOOGLE_APIS_GAIA_GAIA_AUTH_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... | |
28 | 28 |
29 // Returns true if the two specified email addresses are the same. Both | 29 // Returns true if the two specified email addresses are the same. Both |
30 // addresses are first sanitized and then canoncialized before comparing. | 30 // addresses are first sanitized and then canoncialized before comparing. |
31 bool AreEmailsSame(const std::string& email1, const std::string& email2); | 31 bool AreEmailsSame(const std::string& email1, const std::string& email2); |
32 | 32 |
33 // Extract the domain part from the canonical form of the given email. | 33 // Extract the domain part from the canonical form of the given email. |
34 std::string ExtractDomainName(const std::string& email); | 34 std::string ExtractDomainName(const std::string& email); |
35 | 35 |
36 bool IsGaiaSignonRealm(const GURL& url); | 36 bool IsGaiaSignonRealm(const GURL& url); |
37 | 37 |
38 // Parses JSON data returned by /ListAccounts call, returns vector of | 38 // Parses JSON data returned by /ListAccounts call, returning a vector of |
39 // accounts (email addresses). If there an error parsing the JSON, then | 39 // email/valid pairs. An email addresses is considered valid if a passive |
40 // false is returned. | 40 // login would succeed (i.e. the user does not need to reauthenticate). |
41 bool ParseListAccountsData(const std::string& data, | 41 // If there an error parsing the JSON, then false is returned. |
42 std::vector<std::string>* accounts); | 42 bool ParseListAccountsData( |
43 const std::string& data, | |
44 std::vector<std::pair<std::string, bool> >* accounts); | |
bartfab (slow)
2014/02/17 15:22:04
Nit: #include <utility>
Roger Tawa OOO till Jul 10th
2014/02/18 19:37:54
Done.
| |
43 | 45 |
44 } // namespace gaia | 46 } // namespace gaia |
45 | 47 |
46 #endif // GOOGLE_APIS_GAIA_GAIA_AUTH_UTIL_H_ | 48 #endif // GOOGLE_APIS_GAIA_GAIA_AUTH_UTIL_H_ |
OLD | NEW |