| 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 "chrome/browser/ui/sync/one_click_signin_helper.h" | 5 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 return false; | 207 return false; |
| 208 } | 208 } |
| 209 | 209 |
| 210 return true; | 210 return true; |
| 211 } | 211 } |
| 212 | 212 |
| 213 // static | 213 // static |
| 214 void OneClickSigninHelper::ShowInfoBarIfPossible(net::URLRequest* request, | 214 void OneClickSigninHelper::ShowInfoBarIfPossible(net::URLRequest* request, |
| 215 int child_id, | 215 int child_id, |
| 216 int route_id) { | 216 int route_id) { |
| 217 // See if the response contains the X-Google-Accounts-SignIn header. | 217 // See if the response contains the Google-Accounts-SignIn header. |
| 218 std::string value; | 218 std::string value; |
| 219 request->GetResponseHeaderByName("X-Google-Accounts-SignIn", &value); | 219 request->GetResponseHeaderByName("Google-Accounts-SignIn", &value); |
| 220 if (value.empty()) | 220 if (value.empty()) |
| 221 return; | 221 return; |
| 222 | 222 |
| 223 std::vector<std::pair<std::string, std::string> > pairs; | 223 std::vector<std::pair<std::string, std::string> > pairs; |
| 224 if (!base::SplitStringIntoKeyValuePairs(value, '=', ',', &pairs)) | 224 if (!base::SplitStringIntoKeyValuePairs(value, '=', ',', &pairs)) |
| 225 return; | 225 return; |
| 226 | 226 |
| 227 // Parse the information from the value string. | 227 // Parse the information from the value string. |
| 228 std::string email; | 228 std::string email; |
| 229 std::string session_index; | 229 std::string session_index; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 session_index_ = session_index; | 308 session_index_ = session_index; |
| 309 email_ = email; | 309 email_ = email; |
| 310 } | 310 } |
| 311 | 311 |
| 312 void OneClickSigninHelper::SavePassword(const std::string& password) { | 312 void OneClickSigninHelper::SavePassword(const std::string& password) { |
| 313 // TODO(rogerta): in the case of a 2-factor or captcha or some other type of | 313 // TODO(rogerta): in the case of a 2-factor or captcha or some other type of |
| 314 // challenge, its possible for the user to never complete the signin. | 314 // challenge, its possible for the user to never complete the signin. |
| 315 // Should have a way to detect this and clear the password member. | 315 // Should have a way to detect this and clear the password member. |
| 316 password_ = password; | 316 password_ = password; |
| 317 } | 317 } |
| OLD | NEW |