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

Unified Diff: chrome/browser/captive_portal/captive_portal_tab_helper.cc

Issue 318213002: Add custom interstitial for captive portals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android tests, add more uma, address mmenke's comments Created 6 years, 6 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
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

Powered by Google App Engine
This is Rietveld 408576698