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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 !google_chrome_signin_value.empty()) { | 965 !google_chrome_signin_value.empty()) { |
966 VLOG(1) << "OneClickSigninHelper::ShowInfoBarIfPossible:" | 966 VLOG(1) << "OneClickSigninHelper::ShowInfoBarIfPossible:" |
967 << " g-a-s='" << google_accounts_signin_value << "'" | 967 << " g-a-s='" << google_accounts_signin_value << "'" |
968 << " g-c-s='" << google_chrome_signin_value << "'"; | 968 << " g-c-s='" << google_chrome_signin_value << "'"; |
969 } | 969 } |
970 | 970 |
971 if (!gaia::IsGaiaSignonRealm(request->url().GetOrigin())) | 971 if (!gaia::IsGaiaSignonRealm(request->url().GetOrigin())) |
972 return; | 972 return; |
973 | 973 |
974 // Parse Google-Accounts-SignIn. | 974 // Parse Google-Accounts-SignIn. |
975 std::vector<std::pair<std::string, std::string> > pairs; | 975 base::StringPairs pairs; |
976 base::SplitStringIntoKeyValuePairs(google_accounts_signin_value, '=', ',', | 976 base::SplitStringIntoKeyValuePairs(google_accounts_signin_value, '=', ',', |
977 &pairs); | 977 &pairs); |
978 std::string session_index; | 978 std::string session_index; |
979 std::string email; | 979 std::string email; |
980 for (size_t i = 0; i < pairs.size(); ++i) { | 980 for (size_t i = 0; i < pairs.size(); ++i) { |
981 const std::pair<std::string, std::string>& pair = pairs[i]; | 981 const std::pair<std::string, std::string>& pair = pairs[i]; |
982 const std::string& key = pair.first; | 982 const std::string& key = pair.first; |
983 const std::string& value = pair.second; | 983 const std::string& value = pair.second; |
984 if (key == "email") { | 984 if (key == "email") { |
985 base::TrimString(value, "\"", &email); | 985 base::TrimString(value, "\"", &email); |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1597 // If the web contents is showing a blank page and not about to be closed, | 1597 // If the web contents is showing a blank page and not about to be closed, |
1598 // redirect to the NTP or apps page. | 1598 // redirect to the NTP or apps page. |
1599 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && | 1599 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && |
1600 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { | 1600 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { |
1601 RedirectToNtpOrAppsPage( | 1601 RedirectToNtpOrAppsPage( |
1602 web_contents(), | 1602 web_contents(), |
1603 signin::GetSourceForPromoURL(original_continue_url_)); | 1603 signin::GetSourceForPromoURL(original_continue_url_)); |
1604 } | 1604 } |
1605 } | 1605 } |
1606 } | 1606 } |
OLD | NEW |