This source file includes following definitions.
- first_login_tab_load_
- OnStoppedLoading
- OnCaptivePortalResults
- SetIsLoginTab
#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),
first_login_tab_load_(false) {
}
CaptivePortalLoginDetector::~CaptivePortalLoginDetector() {
}
void CaptivePortalLoginDetector::OnStoppedLoading() {
if (!is_login_tab_ || first_login_tab_load_) {
first_login_tab_load_ = false;
return;
}
CaptivePortalServiceFactory::GetForProfile(profile_)->DetectCaptivePortal();
}
void CaptivePortalLoginDetector::OnCaptivePortalResults(
Result previous_result,
Result result) {
if (result != RESULT_BEHIND_CAPTIVE_PORTAL)
is_login_tab_ = false;
}
void CaptivePortalLoginDetector::SetIsLoginTab() {
is_login_tab_ = true;
first_login_tab_load_ = true;
}
}