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

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

Issue 10020051: Open a login tab on captive portal detection on SSL loads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix typo in comment, forward declare CaptivePortalTabReloader in the TabHelper Created 8 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_login_detector.cc
===================================================================
--- chrome/browser/captive_portal/captive_portal_login_detector.cc (revision 0)
+++ chrome/browser/captive_portal/captive_portal_login_detector.cc (revision 0)
@@ -0,0 +1,35 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/captive_portal/captive_portal_login_detector.h"
+
+#include "chrome/browser/captive_portal/captive_portal_service_factory.h"
+
+namespace captive_portal {
+
+CaptivePortalLoginDetector::CaptivePortalLoginDetector(
+ Profile* profile)
+ : profile_(profile),
+ is_login_tab_(false) {
+}
+
+CaptivePortalLoginDetector::~CaptivePortalLoginDetector() {
+}
+
+void CaptivePortalLoginDetector::OnStoppedLoading() {
+ if (!is_login_tab_)
+ return;
+ // The service is guaranteed to exist if |is_login_tab_| is true, since it's
+ // only set to true once a captive portal is detected.
+ CaptivePortalServiceFactory::GetForProfile(profile_)->DetectCaptivePortal();
+}
+
+void CaptivePortalLoginDetector::OnCaptivePortalResults(
+ Result previous_result,
+ Result result) {
+ if (result != RESULT_BEHIND_CAPTIVE_PORTAL)
+ is_login_tab_ = false;
+}
+
+} // namespace captive_portal
« no previous file with comments | « chrome/browser/captive_portal/captive_portal_login_detector.h ('k') | chrome/browser/captive_portal/captive_portal_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698