Regression: Search+Key pops up app launcher
[chromium-blink-merge.git] / components / wifi / network_properties.h
blob52951387cc91e72a3b4bd0d7f7447875d1e2b191
1 // Copyright 2014 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.
5 #ifndef COMPONENTS_WIFI_NETWORK_PROPERTIES_H_
6 #define COMPONENTS_WIFI_NETWORK_PROPERTIES_H_
8 #include <list>
9 #include <set>
11 #include "base/values.h"
12 #include "components/wifi/wifi_export.h"
14 namespace wifi {
16 typedef int32 Frequency;
18 enum FrequencyEnum {
19 kFrequencyAny = 0,
20 kFrequencyUnknown = 0,
21 kFrequency2400 = 2400,
22 kFrequency5000 = 5000
25 typedef std::set<Frequency> FrequencySet;
27 // Network Properties, can be used to parse the result of |GetProperties| and
28 // |GetVisibleNetworks|.
29 struct WIFI_EXPORT NetworkProperties {
30 NetworkProperties();
31 ~NetworkProperties();
33 std::string connection_state;
34 std::string guid;
35 std::string name;
36 std::string ssid;
37 std::string bssid;
38 std::string type;
39 std::string security;
40 // |password| field is used to pass wifi password for network creation via
41 // |CreateNetwork| or connection via |StartConnect|. It does not persist
42 // once operation is completed.
43 std::string password;
44 // WiFi Signal Strength. 0..100
45 uint32 signal_strength;
46 bool auto_connect;
47 Frequency frequency;
48 FrequencySet frequency_set;
50 std::string json_extra; // Extra JSON properties for unit tests
52 scoped_ptr<base::DictionaryValue> ToValue(bool network_list) const;
53 // Updates only properties set in |value|.
54 bool UpdateFromValue(const base::DictionaryValue& value);
55 static std::string MacAddressAsString(const uint8 mac_as_int[6]);
56 static bool OrderByType(const NetworkProperties& l,
57 const NetworkProperties& r);
60 typedef std::list<NetworkProperties> NetworkList;
62 } // namespace wifi
64 #endif // COMPONENTS_WIFI_NETWORK_PROPERTIES_H_