Home | History | Annotate | Download | only in captive_portal
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef NET_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TYPES_H_
      6 #define NET_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TYPES_H_
      7 
      8 #include <string>
      9 
     10 #include "components/captive_portal/captive_portal_export.h"
     11 
     12 namespace captive_portal {
     13 
     14 // Possible results of an attempt to detect a captive portal.
     15 enum CaptivePortalResult {
     16   // There's a confirmed connection to the Internet.
     17   RESULT_INTERNET_CONNECTED,
     18   // The URL request received a network or HTTP error, or a non-HTTP response.
     19   RESULT_NO_RESPONSE,
     20   // The URL request apparently encountered a captive portal.  It received a
     21   // a valid HTTP response with a 2xx other than 204, 3xx, or 511 status code.
     22   RESULT_BEHIND_CAPTIVE_PORTAL,
     23   RESULT_COUNT
     24 };
     25 
     26 CAPTIVE_PORTAL_EXPORT extern std::string CaptivePortalResultToString(
     27     CaptivePortalResult result);
     28 
     29 }  // namespace captive_portal
     30 
     31 #endif  // NET_CAPTIVE_PORTAL_CAPTIVE_PORTAL_TYPES_H_
     32