| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 request->GetResponseHeaderByName("Google-Accounts-SignIn", | 848 request->GetResponseHeaderByName("Google-Accounts-SignIn", |
| 849 &google_accounts_signin_value); | 849 &google_accounts_signin_value); |
| 850 | 850 |
| 851 if (!google_accounts_signin_value.empty() || | 851 if (!google_accounts_signin_value.empty() || |
| 852 !google_chrome_signin_value.empty()) { | 852 !google_chrome_signin_value.empty()) { |
| 853 VLOG(1) << "OneClickSigninHelper::ShowInfoBarIfPossible:" | 853 VLOG(1) << "OneClickSigninHelper::ShowInfoBarIfPossible:" |
| 854 << " g-a-s='" << google_accounts_signin_value << "'" | 854 << " g-a-s='" << google_accounts_signin_value << "'" |
| 855 << " g-c-s='" << google_chrome_signin_value << "'"; | 855 << " g-c-s='" << google_chrome_signin_value << "'"; |
| 856 } | 856 } |
| 857 | 857 |
| 858 if (!gaia::IsGaiaSignonRealm(request->original_url().GetOrigin())) | 858 if (!gaia::IsGaiaSignonRealm(request->url().GetOrigin())) |
| 859 return; | 859 return; |
| 860 | 860 |
| 861 // Parse Google-Accounts-SignIn. | 861 // Parse Google-Accounts-SignIn. |
| 862 std::vector<std::pair<std::string, std::string> > pairs; | 862 std::vector<std::pair<std::string, std::string> > pairs; |
| 863 base::SplitStringIntoKeyValuePairs(google_accounts_signin_value, '=', ',', | 863 base::SplitStringIntoKeyValuePairs(google_accounts_signin_value, '=', ',', |
| 864 &pairs); | 864 &pairs); |
| 865 std::string session_index; | 865 std::string session_index; |
| 866 std::string email; | 866 std::string email; |
| 867 for (size_t i = 0; i < pairs.size(); ++i) { | 867 for (size_t i = 0; i < pairs.size(); ++i) { |
| 868 const std::pair<std::string, std::string>& pair = pairs[i]; | 868 const std::pair<std::string, std::string>& pair = pairs[i]; |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1469 // If the web contents is showing a blank page and not about to be closed, | 1469 // If the web contents is showing a blank page and not about to be closed, |
| 1470 // redirect to the NTP or apps page. | 1470 // redirect to the NTP or apps page. |
| 1471 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && | 1471 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && |
| 1472 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { | 1472 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { |
| 1473 RedirectToNtpOrAppsPage( | 1473 RedirectToNtpOrAppsPage( |
| 1474 web_contents(), | 1474 web_contents(), |
| 1475 signin::GetSourceForPromoURL(original_continue_url_)); | 1475 signin::GetSourceForPromoURL(original_continue_url_)); |
| 1476 } | 1476 } |
| 1477 } | 1477 } |
| 1478 } | 1478 } |
| OLD | NEW |