OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_DETECTOR_H_ | 5 #ifndef CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_DETECTOR_H_ |
6 #define CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_DETECTOR_H_ | 6 #define CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_DETECTOR_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 public: | 37 public: |
38 struct Results { | 38 struct Results { |
39 Results() | 39 Results() |
40 : result(RESULT_NO_RESPONSE), | 40 : result(RESULT_NO_RESPONSE), |
41 response_code(net::URLFetcher::RESPONSE_CODE_INVALID) { | 41 response_code(net::URLFetcher::RESPONSE_CODE_INVALID) { |
42 } | 42 } |
43 | 43 |
44 Result result; | 44 Result result; |
45 int response_code; | 45 int response_code; |
46 base::TimeDelta retry_after_delta; | 46 base::TimeDelta retry_after_delta; |
| 47 GURL landing_url; |
47 }; | 48 }; |
48 | 49 |
49 typedef base::Callback<void(const Results& results)> DetectionCallback; | 50 typedef base::Callback<void(const Results& results)> DetectionCallback; |
50 | 51 |
51 // The test URL. When connected to the Internet, it should return a | 52 // The test URL. When connected to the Internet, it should return a |
52 // blank page with a 204 status code. When behind a captive portal, | 53 // blank page with a 204 status code. When behind a captive portal, |
53 // requests for this URL should get an HTTP redirect or a login | 54 // requests for this URL should get an HTTP redirect or a login |
54 // page. When neither is true, no server should respond to requests | 55 // page. When neither is true, no server should respond to requests |
55 // for this URL. | 56 // for this URL. |
56 static const char kDefaultURL[]; | 57 static const char kDefaultURL[]; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 109 |
109 // Test time used by unit tests. | 110 // Test time used by unit tests. |
110 base::Time time_for_testing_; | 111 base::Time time_for_testing_; |
111 | 112 |
112 DISALLOW_COPY_AND_ASSIGN(CaptivePortalDetector); | 113 DISALLOW_COPY_AND_ASSIGN(CaptivePortalDetector); |
113 }; | 114 }; |
114 | 115 |
115 } // namespace captive_portal | 116 } // namespace captive_portal |
116 | 117 |
117 #endif // CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_DETECTOR_H_ | 118 #endif // CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_DETECTOR_H_ |
OLD | NEW |