Skip to content

Commit

Permalink
Experimentally enable captive portal detection on OSX
Browse files Browse the repository at this point in the history
Lion and greater.  OSX's captive portal detection doesn't
seem to work in some cases where Chrome's does.

BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257293 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
mmenke@chromium.org committed Mar 15, 2014
1 parent d7f6304 commit e7d2bd7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions chrome/browser/captive_portal/captive_portal_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ void RecordRepeatHistograms(Result result,
result_duration_histogram->AddTime(result_duration);
}

bool HasNativeCaptivePortalDetection() {
// Lion and Windows 8 have their own captive portal detection that will open
// a browser window as needed.
#if defined(OS_MACOSX)
return base::mac::IsOSLionOrLater();
#elif defined(OS_WIN)
bool ShouldDeferToNativeCaptivePortalDetection() {
// On Windows 8, defer to the native captive portal detection. OSX Lion and
// later also have captive portal detection, but experimentally, this code
// works in cases its does not.
//
// TODO(mmenke): Investigate how well Windows 8's captive portal detection
// works.
#if defined(OS_WIN)
return base::win::GetVersion() >= base::win::VERSION_WIN8;
#else
return false;
Expand Down Expand Up @@ -300,7 +302,7 @@ void CaptivePortalService::UpdateEnabledState() {
resolve_errors_with_web_service_.GetValue();

if (testing_state_ != SKIP_OS_CHECK_FOR_TESTING &&
HasNativeCaptivePortalDetection()) {
ShouldDeferToNativeCaptivePortalDetection()) {
enabled_ = false;
}

Expand Down

0 comments on commit e7d2bd7

Please sign in to comment.