Chromium Code Reviews| 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 <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 class GURL; | 12 class GURL; |
| 13 | 13 |
| 14 namespace net { | |
| 15 class URLRequest; | |
| 16 class URLFetcher; | |
|
tbansal1
2017/01/23 21:03:05
nit: Alphabetical order.
Raj
2017/01/23 21:53:02
Done.
| |
| 17 }; | |
|
tbansal1
2017/01/23 21:03:05
// namespace net
Also rm semicolon
Raj
2017/01/23 21:53:02
Done.
| |
| 18 | |
| 14 namespace gaia { | 19 namespace gaia { |
| 15 | 20 |
| 16 struct ListedAccount { | 21 struct ListedAccount { |
| 17 // The account's ID, as per Chrome, will be determined in the | 22 // The account's ID, as per Chrome, will be determined in the |
| 18 // CookieManagerService. | 23 // CookieManagerService. |
| 19 std::string id; | 24 std::string id; |
| 20 std::string email; | 25 std::string email; |
| 21 std::string gaia_id; | 26 std::string gaia_id; |
| 22 std::string raw_email; | 27 std::string raw_email; |
| 23 bool valid; | 28 bool valid; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 52 // Parses JSON data returned by /ListAccounts call, returning a vector of | 57 // Parses JSON data returned by /ListAccounts call, returning a vector of |
| 53 // email/valid pairs. An email addresses is considered valid if a passive | 58 // email/valid pairs. An email addresses is considered valid if a passive |
| 54 // login would succeed (i.e. the user does not need to reauthenticate). | 59 // login would succeed (i.e. the user does not need to reauthenticate). |
| 55 // If there an error parsing the JSON, then false is returned. | 60 // If there an error parsing the JSON, then false is returned. |
| 56 // If either |accounts| or |signed_out_accounts| is null, the corresponding | 61 // If either |accounts| or |signed_out_accounts| is null, the corresponding |
| 57 // accounts returned from /ListAccounts will be ignored. | 62 // accounts returned from /ListAccounts will be ignored. |
| 58 bool ParseListAccountsData(const std::string& data, | 63 bool ParseListAccountsData(const std::string& data, |
| 59 std::vector<ListedAccount>* accounts, | 64 std::vector<ListedAccount>* accounts, |
| 60 std::vector<ListedAccount>* signed_out_accounts); | 65 std::vector<ListedAccount>* signed_out_accounts); |
| 61 | 66 |
| 67 // Returns true if the URL request originated from GAIA. | |
| 68 bool RequestOriginatedFromGaia(const net::URLRequest& request); | |
| 69 | |
| 70 // Marks the URL request as a Gaia request. | |
| 71 void MarkURLFetcherAsGaia(net::URLFetcher* request); | |
| 72 | |
| 62 } // namespace gaia | 73 } // namespace gaia |
| 63 | 74 |
| 64 #endif // GOOGLE_APIS_GAIA_GAIA_AUTH_UTIL_H_ | 75 #endif // GOOGLE_APIS_GAIA_GAIA_AUTH_UTIL_H_ |
| OLD | NEW |