summaryrefslogtreecommitdiffstats
path: root/components/captive_portal/captive_portal_types.h
blob: 57319d739cc384e12856106ef6d3f7987167b221 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// 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.

#ifndef NET_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TYPES_H_
#define NET_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TYPES_H_

#include <string>

#include "components/captive_portal/captive_portal_export.h"

namespace captive_portal {

// Possible results of an attempt to detect a captive portal.
enum CaptivePortalResult {
  // There's a confirmed connection to the Internet.
  RESULT_INTERNET_CONNECTED,
  // The URL request received a network or HTTP error, or a non-HTTP response.
  RESULT_NO_RESPONSE,
  // The URL request apparently encountered a captive portal.  It received a
  // a valid HTTP response with a 2xx other than 204, 3xx, or 511 status code.
  RESULT_BEHIND_CAPTIVE_PORTAL,
  RESULT_COUNT
};

CAPTIVE_PORTAL_EXPORT extern std::string CaptivePortalResultToString(
    CaptivePortalResult result);

}  // namespace captive_portal

#endif  // NET_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TYPES_H_