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_UTILITY_WIFI_WIFI_SERVICE_H_ | 5 #ifndef CHROME_UTILITY_WIFI_WIFI_SERVICE_H_ |
6 #define CHROME_UTILITY_WIFI_WIFI_SERVICE_H_ | 6 #define CHROME_UTILITY_WIFI_WIFI_SERVICE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
| 9 #include <set> |
9 #include <string> | 10 #include <string> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/callback.h" | 13 #include "base/callback.h" |
13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
14 #include "base/message_loop/message_loop_proxy.h" | 15 #include "base/message_loop/message_loop_proxy.h" |
15 #include "base/threading/sequenced_worker_pool.h" | 16 #include "base/threading/sequenced_worker_pool.h" |
16 #include "base/values.h" | 17 #include "base/values.h" |
17 #include "components/wifi/wifi_export.h" | 18 #include "components/wifi/wifi_export.h" |
18 | 19 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 WiFiService() {} | 82 WiFiService() {} |
82 | 83 |
83 typedef int32 Frequency; | 84 typedef int32 Frequency; |
84 enum FrequencyEnum { | 85 enum FrequencyEnum { |
85 kFrequencyAny = 0, | 86 kFrequencyAny = 0, |
86 kFrequencyUnknown = 0, | 87 kFrequencyUnknown = 0, |
87 kFrequency2400 = 2400, | 88 kFrequency2400 = 2400, |
88 kFrequency5000 = 5000 | 89 kFrequency5000 = 5000 |
89 }; | 90 }; |
90 | 91 |
91 typedef std::list<Frequency> FrequencyList; | 92 typedef std::set<Frequency> FrequencySet; |
92 // Network Properties, used as result of |GetProperties| and | 93 // Network Properties, used as result of |GetProperties| and |
93 // |GetVisibleNetworks|. | 94 // |GetVisibleNetworks|. |
94 struct WIFI_EXPORT NetworkProperties { | 95 struct WIFI_EXPORT NetworkProperties { |
95 NetworkProperties(); | 96 NetworkProperties(); |
96 ~NetworkProperties(); | 97 ~NetworkProperties(); |
97 | 98 |
98 std::string connection_state; | 99 std::string connection_state; |
99 std::string guid; | 100 std::string guid; |
100 std::string name; | 101 std::string name; |
101 std::string ssid; | 102 std::string ssid; |
102 std::string bssid; | 103 std::string bssid; |
103 std::string type; | 104 std::string type; |
104 std::string security; | 105 std::string security; |
105 // WiFi Signal Strength. 0..100 | 106 // WiFi Signal Strength. 0..100 |
106 uint32 signal_strength; | 107 uint32 signal_strength; |
107 bool auto_connect; | 108 bool auto_connect; |
108 Frequency frequency; | 109 Frequency frequency; |
109 FrequencyList frequency_list; | 110 FrequencySet frequency_set; |
110 | 111 |
111 std::string json_extra; // Extra JSON properties for unit tests | 112 std::string json_extra; // Extra JSON properties for unit tests |
112 | 113 |
113 scoped_ptr<base::DictionaryValue> ToValue(bool network_list) const; | 114 scoped_ptr<base::DictionaryValue> ToValue(bool network_list) const; |
114 bool UpdateFromValue(const base::DictionaryValue& value); | 115 bool UpdateFromValue(const base::DictionaryValue& value); |
115 static std::string MacAddressAsString(const uint8 mac_as_int[6]); | 116 static std::string MacAddressAsString(const uint8 mac_as_int[6]); |
116 static bool OrderByType(const NetworkProperties& l, | 117 static bool OrderByType(const NetworkProperties& l, |
117 const NetworkProperties& r); | 118 const NetworkProperties& r); |
118 }; | 119 }; |
119 | 120 |
120 typedef std::list<NetworkProperties> NetworkList; | 121 typedef std::list<NetworkProperties> NetworkList; |
121 | 122 |
122 private: | 123 private: |
123 DISALLOW_COPY_AND_ASSIGN(WiFiService); | 124 DISALLOW_COPY_AND_ASSIGN(WiFiService); |
124 }; | 125 }; |
125 } // namespace wifi | 126 } // namespace wifi |
126 #endif // CHROME_UTILITY_WIFI_WIFI_SERVICE_H_ | 127 #endif // CHROME_UTILITY_WIFI_WIFI_SERVICE_H_ |
OLD | NEW |