| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_SIGNIN_HELPER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_SIGNIN_HELPER_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_SIGNIN_HELPER_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_SIGNIN_HELPER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // URLFetcherDelegate implementation. | 101 // URLFetcherDelegate implementation. |
| 102 virtual void OnURLFetchComplete(const net::URLFetcher* fetcher) OVERRIDE; | 102 virtual void OnURLFetchComplete(const net::URLFetcher* fetcher) OVERRIDE; |
| 103 | 103 |
| 104 // Initiates fetching of the currently signed-in user information. | 104 // Initiates fetching of the currently signed-in user information. |
| 105 void StartFetchingUserNameFromSession(); | 105 void StartFetchingUserNameFromSession(); |
| 106 | 106 |
| 107 // Processes the user information received from the server by url_fetcher_ | 107 // Processes the user information received from the server by url_fetcher_ |
| 108 // and calls the delegate callbacks on success/failure. | 108 // and calls the delegate callbacks on success/failure. |
| 109 void ProcessGetAccountInfoResponseAndFinish(); | 109 void ProcessGetAccountInfoResponseAndFinish(); |
| 110 | 110 |
| 111 // Attempts to parse a response from the Online Wallet sign-in. |
| 112 // Returns true if the response is correct and the sign-in has succeeded. |
| 113 // Otherwise, it calls OnServiceError() and returns false. |
| 114 bool ParseSignInResponse(); |
| 115 |
| 111 // Attempts to parse the GetAccountInfo response from the server. | 116 // Attempts to parse the GetAccountInfo response from the server. |
| 112 // Returns true on success; the obtained email address is stored into |email|. | 117 // Returns true on success; the obtained email address is stored into |email|. |
| 113 bool ParseGetAccountInfoResponse(const net::URLFetcher* fetcher, | 118 bool ParseGetAccountInfoResponse(const net::URLFetcher* fetcher, |
| 114 std::string* email); | 119 std::string* email); |
| 115 | 120 |
| 116 // Should be valid throughout the lifetime of the instance. | 121 // Should be valid throughout the lifetime of the instance. |
| 117 WalletSigninHelperDelegate* const delegate_; | 122 WalletSigninHelperDelegate* const delegate_; |
| 118 | 123 |
| 119 // URLRequestContextGetter to be used for URLFetchers. | 124 // URLRequestContextGetter to be used for URLFetchers. |
| 120 net::URLRequestContextGetter* const getter_; | 125 net::URLRequestContextGetter* const getter_; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 137 // Current internal state of the helper. | 142 // Current internal state of the helper. |
| 138 State state_; | 143 State state_; |
| 139 | 144 |
| 140 DISALLOW_COPY_AND_ASSIGN(WalletSigninHelper); | 145 DISALLOW_COPY_AND_ASSIGN(WalletSigninHelper); |
| 141 }; | 146 }; |
| 142 | 147 |
| 143 } // namespace wallet | 148 } // namespace wallet |
| 144 } // namespace autofill | 149 } // namespace autofill |
| 145 | 150 |
| 146 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_SIGNIN_HELPER_H_ | 151 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_WALLET_SIGNIN_HELPER_H_ |
| OLD | NEW |