| Index: chrome/browser/captive_portal/captive_portal_detector.cc
|
| diff --git a/chrome/browser/captive_portal/captive_portal_detector.cc b/chrome/browser/captive_portal/captive_portal_detector.cc
|
| index 4c59437cbf662699fc5864d7bfc8ab88cfb4f57f..ce5079e45ed2335face3e881957f4cbb665b87ef 100644
|
| --- a/chrome/browser/captive_portal/captive_portal_detector.cc
|
| +++ b/chrome/browser/captive_portal/captive_portal_detector.cc
|
| @@ -14,6 +14,19 @@
|
|
|
| namespace captive_portal {
|
|
|
| +namespace {
|
| +
|
| +const char* const kCaptivePortalResultNames[] = {
|
| + "InternetConnected",
|
| + "NoResponse",
|
| + "BehindCaptivePortal",
|
| + "NumCaptivePortalResults",
|
| +};
|
| +COMPILE_ASSERT(arraysize(kCaptivePortalResultNames) == RESULT_COUNT + 1,
|
| + captive_portal_result_name_count_mismatch);
|
| +
|
| +} // namespace
|
| +
|
| const char CaptivePortalDetector::kDefaultURL[] =
|
| "http://www.gstatic.com/generate_204";
|
|
|
| @@ -58,6 +71,14 @@ void CaptivePortalDetector::Cancel() {
|
| detection_callback_.Reset();
|
| }
|
|
|
| +// static
|
| +std::string CaptivePortalDetector::CaptivePortalResultToString(Result result) {
|
| + DCHECK_GE(result, 0);
|
| + DCHECK_LT(static_cast<unsigned int>(result),
|
| + arraysize(kCaptivePortalResultNames));
|
| + return kCaptivePortalResultNames[result];
|
| +}
|
| +
|
| void CaptivePortalDetector::OnURLFetchComplete(const net::URLFetcher* source) {
|
| DCHECK(CalledOnValidThread());
|
| DCHECK(FetchingURL());
|
|
|