Commit b93356a0 authored by guohui's avatar guohui Committed by Commit bot

Open continue url from gaia incognito header

BUG=414247

Review URL: https://codereview.chromium.org/597603003

Cr-Commit-Position: refs/heads/master@{#296495}
parent 7015281c
...@@ -77,11 +77,13 @@ MirrorResponseHeaderDictionary ParseMirrorResponseHeader( ...@@ -77,11 +77,13 @@ MirrorResponseHeaderDictionary ParseMirrorResponseHeader(
i != fields.end(); ++i) { i != fields.end(); ++i) {
std::string field(*i); std::string field(*i);
std::vector<std::string> tokens; 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 << "'."; DLOG(WARNING) << "Unexpected GAIA header field '" << field << "'.";
continue; continue;
} }
dictionary[tokens[0]] = tokens[1]; dictionary[field.substr(0, delim)] = net::UnescapeURLComponent(
field.substr(delim + 1), net::UnescapeRule::URL_SPECIAL_CHARS);
} }
return dictionary; return dictionary;
} }
...@@ -140,7 +142,7 @@ void ProcessMirrorHeaderUIThread( ...@@ -140,7 +142,7 @@ void ProcessMirrorHeaderUIThread(
chrome::NewIncognitoWindow(browser); chrome::NewIncognitoWindow(browser);
return; return;
case signin::GAIA_SERVICE_TYPE_ADDSESSION: case signin::GAIA_SERVICE_TYPE_ADDSESSION:
bubble_mode = BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN; bubble_mode = BrowserWindow::AVATAR_BUBBLE_MODE_ADD_ACCOUNT;
break; break;
case signin::GAIA_SERVICE_TYPE_REAUTH: case signin::GAIA_SERVICE_TYPE_REAUTH:
bubble_mode = BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH; bubble_mode = BrowserWindow::AVATAR_BUBBLE_MODE_REAUTH;
...@@ -153,9 +155,12 @@ void ProcessMirrorHeaderUIThread( ...@@ -153,9 +155,12 @@ void ProcessMirrorHeaderUIThread(
} }
#else // defined(OS_ANDROID) #else // defined(OS_ANDROID)
if (service_type == signin::GAIA_SERVICE_TYPE_INCOGNITO) { 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( web_contents->OpenURL(content::OpenURLParams(
GURL(chrome::kChromeUINativeNewTabURL), content::Referrer(), url, content::Referrer(), OFF_THE_RECORD,
OFF_THE_RECORD, ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false)); ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false));
} else { } else {
AccountManagementScreenHelper::OpenAccountManagementScreen( AccountManagementScreenHelper::OpenAccountManagementScreen(
Profile::FromBrowserContext(web_contents->GetBrowserContext()), Profile::FromBrowserContext(web_contents->GetBrowserContext()),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment