| Index: chrome/browser/captive_portal/captive_portal_tab_helper.cc
|
| diff --git a/chrome/browser/captive_portal/captive_portal_tab_helper.cc b/chrome/browser/captive_portal/captive_portal_tab_helper.cc
|
| index d939bdaec5a99cb906a6acea4c9fc02fa199e557..4d4a0aa2a857aabd372c3a318b50177ade4c6654 100644
|
| --- a/chrome/browser/captive_portal/captive_portal_tab_helper.cc
|
| +++ b/chrome/browser/captive_portal/captive_portal_tab_helper.cc
|
| @@ -41,7 +41,7 @@ CaptivePortalTabHelper::CaptivePortalTabHelper(
|
| profile_,
|
| web_contents,
|
| base::Bind(&CaptivePortalTabHelper::OpenLoginTab,
|
| - base::Unretained(this)))),
|
| + base::Unretained(this), false))),
|
| login_detector_(new CaptivePortalLoginDetector(profile_)),
|
| web_contents_(web_contents),
|
| pending_error_code_(net::OK),
|
| @@ -239,7 +239,7 @@ CaptivePortalTabReloader* CaptivePortalTabHelper::GetTabReloaderForTest() {
|
| return tab_reloader_.get();
|
| }
|
|
|
| -void CaptivePortalTabHelper::OpenLoginTab() {
|
| +void CaptivePortalTabHelper::OpenLoginTab(bool focus) {
|
| Browser* browser = chrome::FindBrowserWithWebContents(web_contents_);
|
|
|
| // If the Profile doesn't have a tabbed browser window open, do nothing.
|
| @@ -255,8 +255,11 @@ void CaptivePortalTabHelper::OpenLoginTab() {
|
| browser->tab_strip_model()->GetWebContentsAt(i);
|
| CaptivePortalTabHelper* captive_portal_tab_helper =
|
| CaptivePortalTabHelper::FromWebContents(web_contents);
|
| - if (captive_portal_tab_helper->IsLoginTab())
|
| + if (captive_portal_tab_helper->IsLoginTab()) {
|
| + if (focus)
|
| + browser->tab_strip_model()->ActivateTabAt(i, false);
|
| return;
|
| + }
|
| }
|
|
|
| // Otherwise, open a login tab. Only end up here when a captive portal result
|
|
|