OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_IMPL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_IMPL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_IMPL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_IMPL_H_ |
7 | 7 |
| 8 #include <map> |
8 #include <memory> | 9 #include <memory> |
9 #include <string> | 10 #include <string> |
10 | 11 |
11 #include "base/cancelable_callback.h" | 12 #include "base/cancelable_callback.h" |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "base/containers/hash_tables.h" | |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
18 #include "base/threading/non_thread_safe.h" | 18 #include "base/threading/non_thread_safe.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 #include "chromeos/network/network_state_handler_observer.h" | 20 #include "chromeos/network/network_state_handler_observer.h" |
21 #include "chromeos/network/portal_detector/network_portal_detector.h" | 21 #include "chromeos/network/portal_detector/network_portal_detector.h" |
22 #include "chromeos/network/portal_detector/network_portal_detector_strategy.h" | 22 #include "chromeos/network/portal_detector/network_portal_detector_strategy.h" |
23 #include "components/captive_portal/captive_portal_detector.h" | 23 #include "components/captive_portal/captive_portal_detector.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // Set the URL to be tested for portal state. | 69 // Set the URL to be tested for portal state. |
70 void set_portal_test_url(const GURL& portal_test_url) { | 70 void set_portal_test_url(const GURL& portal_test_url) { |
71 portal_test_url_ = portal_test_url; | 71 portal_test_url_ = portal_test_url; |
72 } | 72 } |
73 | 73 |
74 private: | 74 private: |
75 friend class ::NetworkingConfigTest; | 75 friend class ::NetworkingConfigTest; |
76 friend class NetworkPortalDetectorImplTest; | 76 friend class NetworkPortalDetectorImplTest; |
77 friend class NetworkPortalDetectorImplBrowserTest; | 77 friend class NetworkPortalDetectorImplBrowserTest; |
78 | 78 |
79 using CaptivePortalStateMap = base::hash_map<std::string, CaptivePortalState>; | 79 using CaptivePortalStateMap = std::map<std::string, CaptivePortalState>; |
80 | 80 |
81 enum State { | 81 enum State { |
82 // No portal check is running. | 82 // No portal check is running. |
83 STATE_IDLE = 0, | 83 STATE_IDLE = 0, |
84 // Waiting for portal check. | 84 // Waiting for portal check. |
85 STATE_PORTAL_CHECK_PENDING, | 85 STATE_PORTAL_CHECK_PENDING, |
86 // Portal check is in progress. | 86 // Portal check is in progress. |
87 STATE_CHECKING_FOR_PORTAL, | 87 STATE_CHECKING_FOR_PORTAL, |
88 }; | 88 }; |
89 | 89 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 DetectionAttemptCompletedReport attempt_completed_report_; | 271 DetectionAttemptCompletedReport attempt_completed_report_; |
272 | 272 |
273 base::WeakPtrFactory<NetworkPortalDetectorImpl> weak_factory_; | 273 base::WeakPtrFactory<NetworkPortalDetectorImpl> weak_factory_; |
274 | 274 |
275 DISALLOW_COPY_AND_ASSIGN(NetworkPortalDetectorImpl); | 275 DISALLOW_COPY_AND_ASSIGN(NetworkPortalDetectorImpl); |
276 }; | 276 }; |
277 | 277 |
278 } // namespace chromeos | 278 } // namespace chromeos |
279 | 279 |
280 #endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_IMPL_H_ | 280 #endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_IMPL_H_ |
OLD | NEW |