Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Side by Side Diff: chrome/browser/ui/sync/one_click_signin_helper.cc

Issue 102843002: Move RemoveChars, ReplaceChars, TrimString, and TruncateUTF8ToByteSize to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 std::vector<std::pair<std::string, std::string> > pairs; 853 std::vector<std::pair<std::string, std::string> > pairs;
854 base::SplitStringIntoKeyValuePairs(google_accounts_signin_value, '=', ',', 854 base::SplitStringIntoKeyValuePairs(google_accounts_signin_value, '=', ',',
855 &pairs); 855 &pairs);
856 std::string session_index; 856 std::string session_index;
857 std::string email; 857 std::string email;
858 for (size_t i = 0; i < pairs.size(); ++i) { 858 for (size_t i = 0; i < pairs.size(); ++i) {
859 const std::pair<std::string, std::string>& pair = pairs[i]; 859 const std::pair<std::string, std::string>& pair = pairs[i];
860 const std::string& key = pair.first; 860 const std::string& key = pair.first;
861 const std::string& value = pair.second; 861 const std::string& value = pair.second;
862 if (key == "email") { 862 if (key == "email") {
863 TrimString(value, "\"", &email); 863 base::TrimString(value, "\"", &email);
864 } else if (key == "sessionindex") { 864 } else if (key == "sessionindex") {
865 session_index = value; 865 session_index = value;
866 } 866 }
867 } 867 }
868 868
869 // Later in the chain of this request, we'll need to check the email address 869 // Later in the chain of this request, we'll need to check the email address
870 // in the IO thread (see CanOfferOnIOThread). So save the email address as 870 // in the IO thread (see CanOfferOnIOThread). So save the email address as
871 // user data on the request (only for web-based flow). 871 // user data on the request (only for web-based flow).
872 if (!email.empty()) 872 if (!email.empty())
873 io_data->set_reverse_autologin_pending_email(email); 873 io_data->set_reverse_autologin_pending_email(email);
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 // If the web contents is showing a blank page and not about to be closed, 1480 // If the web contents is showing a blank page and not about to be closed,
1481 // redirect to the NTP or apps page. 1481 // redirect to the NTP or apps page.
1482 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && 1482 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) &&
1483 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { 1483 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) {
1484 RedirectToNtpOrAppsPage( 1484 RedirectToNtpOrAppsPage(
1485 web_contents(), 1485 web_contents(),
1486 signin::GetSourceForPromoURL(original_continue_url_)); 1486 signin::GetSourceForPromoURL(original_continue_url_));
1487 } 1487 }
1488 } 1488 }
1489 } 1489 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698