OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_TEST_IMPL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_TEST_IMPL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_TEST_IMPL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_TEST_IMPL_H_ |
7 | 7 |
| 8 #include <map> |
8 #include <memory> | 9 #include <memory> |
9 #include <string> | 10 #include <string> |
10 | 11 |
11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
12 #include "base/containers/hash_tables.h" | |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
15 #include "chromeos/network/portal_detector/network_portal_detector.h" | 15 #include "chromeos/network/portal_detector/network_portal_detector.h" |
16 | 16 |
17 namespace chromeos { | 17 namespace chromeos { |
18 | 18 |
19 class NetworkPortalDetectorTestImpl : public NetworkPortalDetector { | 19 class NetworkPortalDetectorTestImpl : public NetworkPortalDetector { |
20 public: | 20 public: |
21 NetworkPortalDetectorTestImpl(); | 21 NetworkPortalDetectorTestImpl(); |
22 ~NetworkPortalDetectorTestImpl() override; | 22 ~NetworkPortalDetectorTestImpl() override; |
(...skipping 14 matching lines...) Expand all Loading... |
37 bool StartDetectionIfIdle() override; | 37 bool StartDetectionIfIdle() override; |
38 | 38 |
39 void SetStrategy(PortalDetectorStrategy::StrategyId id) override; | 39 void SetStrategy(PortalDetectorStrategy::StrategyId id) override; |
40 void OnLockScreenRequest() override; | 40 void OnLockScreenRequest() override; |
41 | 41 |
42 PortalDetectorStrategy::StrategyId strategy_id() const { | 42 PortalDetectorStrategy::StrategyId strategy_id() const { |
43 return strategy_id_; | 43 return strategy_id_; |
44 } | 44 } |
45 | 45 |
46 private: | 46 private: |
47 typedef std::string NetworkId; | 47 using NetworkId = std::string; |
48 typedef base::hash_map<NetworkId, CaptivePortalState> CaptivePortalStateMap; | 48 using CaptivePortalStateMap = std::map<NetworkId, CaptivePortalState>; |
49 | 49 |
50 base::ObserverList<Observer> observers_; | 50 base::ObserverList<Observer> observers_; |
51 std::unique_ptr<NetworkState> default_network_; | 51 std::unique_ptr<NetworkState> default_network_; |
52 CaptivePortalStateMap portal_state_map_; | 52 CaptivePortalStateMap portal_state_map_; |
53 PortalDetectorStrategy::StrategyId strategy_id_; | 53 PortalDetectorStrategy::StrategyId strategy_id_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(NetworkPortalDetectorTestImpl); | 55 DISALLOW_COPY_AND_ASSIGN(NetworkPortalDetectorTestImpl); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace chromeos | 58 } // namespace chromeos |
59 | 59 |
60 #endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_TEST_IMPL_H_ | 60 #endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_TEST_IMPL_H_ |
OLD | NEW |