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

Unified Diff: chrome/browser/signin/signin_header_helper.cc

Issue 597603003: Open continue url from gaia incognito header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: url-decode header value Created 6 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/signin_header_helper.cc
diff --git a/chrome/browser/signin/signin_header_helper.cc b/chrome/browser/signin/signin_header_helper.cc
index 2e479e25a5056e12959da4cf4014d34cecd9aab2..8337413e4f4919ee37f2c39f1ecfb80052628fab 100644
--- a/chrome/browser/signin/signin_header_helper.cc
+++ b/chrome/browser/signin/signin_header_helper.cc
@@ -77,11 +77,13 @@ MirrorResponseHeaderDictionary ParseMirrorResponseHeader(
i != fields.end(); ++i) {
std::string field(*i);
std::vector<std::string> tokens;
- if (Tokenize(field, "=", &tokens) != 2) {
+ size_t delim = field.find_first_of('=');
+ if (delim == std::string::npos) {
DLOG(WARNING) << "Unexpected GAIA header field '" << field << "'.";
continue;
}
- dictionary[tokens[0]] = tokens[1];
+ dictionary[field.substr(0, delim)] = net::UnescapeURLComponent(
+ field.substr(delim + 1), net::UnescapeRule::URL_SPECIAL_CHARS);
}
return dictionary;
}
@@ -140,7 +142,7 @@ void ProcessMirrorHeaderUIThread(
chrome::NewIncognitoWindow(browser);
return;
case signin::GAIA_SERVICE_TYPE_ADDSESSION:
- bubble_mode = BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN;
+ bubble_mode = BrowserWindow::AVATAR_BUBBLE_MODE_ADD_ACCOUNT;
break;
case signin::GAIA_SERVICE_TYPE_REAUTH:
bubble_mode = BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH;
@@ -153,9 +155,12 @@ void ProcessMirrorHeaderUIThread(
}
#else // defined(OS_ANDROID)
if (service_type == signin::GAIA_SERVICE_TYPE_INCOGNITO) {
+ GURL url(manage_accounts_params.continue_url.empty() ?
+ chrome::kChromeUINativeNewTabURL :
+ manage_accounts_params.continue_url);
web_contents->OpenURL(content::OpenURLParams(
- GURL(chrome::kChromeUINativeNewTabURL), content::Referrer(),
- OFF_THE_RECORD, ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false));
+ url, content::Referrer(), OFF_THE_RECORD,
+ ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false));
} else {
AccountManagementScreenHelper::OpenAccountManagementScreen(
Profile::FromBrowserContext(web_contents->GetBrowserContext()),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698