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 CHROMEOS_NETWORK_NETWORK_STATE_H_ | 5 #ifndef CHROMEOS_NETWORK_NETWORK_STATE_H_ |
6 #define CHROMEOS_NETWORK_NETWORK_STATE_H_ | 6 #define CHROMEOS_NETWORK_NETWORK_STATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
| 11 #include "base/values.h" |
11 #include "chromeos/network/managed_state.h" | 12 #include "chromeos/network/managed_state.h" |
12 | 13 #include "chromeos/network/onc/onc_constants.h" |
13 namespace base { | |
14 class DictionaryValue; | |
15 } | |
16 | 14 |
17 namespace chromeos { | 15 namespace chromeos { |
18 | 16 |
19 // Simple class to provide network state information about a network service. | 17 // Simple class to provide network state information about a network service. |
20 // This class should always be passed as a const* and should never be held | 18 // This class should always be passed as a const* and should never be held |
21 // on to. Store network_state->path() (defined in ManagedState) instead and | 19 // on to. Store network_state->path() (defined in ManagedState) instead and |
22 // call NetworkStateHandler::GetNetworkState(path) to retrieve the state for | 20 // call NetworkStateHandler::GetNetworkState(path) to retrieve the state for |
23 // the network. | 21 // the network. |
24 class CHROMEOS_EXPORT NetworkState : public ManagedState { | 22 class CHROMEOS_EXPORT NetworkState : public ManagedState { |
25 public: | 23 public: |
(...skipping 16 matching lines...) Expand all Loading... |
42 const std::string& ip_address() const { return ip_address_; } | 40 const std::string& ip_address() const { return ip_address_; } |
43 const std::vector<std::string>& dns_servers() const { return dns_servers_; } | 41 const std::vector<std::string>& dns_servers() const { return dns_servers_; } |
44 const std::string& device_path() const { return device_path_; } | 42 const std::string& device_path() const { return device_path_; } |
45 const std::string& guid() const { return guid_; } | 43 const std::string& guid() const { return guid_; } |
46 const std::string& connection_state() const { return connection_state_; } | 44 const std::string& connection_state() const { return connection_state_; } |
47 const std::string& profile_path() const { return profile_path_; } | 45 const std::string& profile_path() const { return profile_path_; } |
48 const std::string& error() const { return error_; } | 46 const std::string& error() const { return error_; } |
49 bool auto_connect() const { return auto_connect_; } | 47 bool auto_connect() const { return auto_connect_; } |
50 bool favorite() const { return favorite_; } | 48 bool favorite() const { return favorite_; } |
51 int priority() const { return priority_; } | 49 int priority() const { return priority_; } |
| 50 const base::DictionaryValue& proxy_config() const { return proxy_config_; } |
| 51 onc::ONCSource onc_source() const { return onc_source_; } |
52 // Wireless property accessors | 52 // Wireless property accessors |
53 int signal_strength() const { return signal_strength_; } | 53 int signal_strength() const { return signal_strength_; } |
54 // Cellular property accessors | 54 // Cellular property accessors |
55 const std::string& technology() const { return technology_; } | 55 const std::string& technology() const { return technology_; } |
56 const std::string& activation_state() const { return activation_state_; } | 56 const std::string& activation_state() const { return activation_state_; } |
57 const std::string& roaming() const { return roaming_; } | 57 const std::string& roaming() const { return roaming_; } |
58 bool activate_over_non_cellular_networks() const { | 58 bool activate_over_non_cellular_networks() const { |
59 return activate_over_non_cellular_networks_; | 59 return activate_over_non_cellular_networks_; |
60 } | 60 } |
61 bool cellular_out_of_credits() const { return cellular_out_of_credits_; } | 61 bool cellular_out_of_credits() const { return cellular_out_of_credits_; } |
(...skipping 27 matching lines...) Expand all Loading... |
89 // Common Network Service properties | 89 // Common Network Service properties |
90 std::string security_; | 90 std::string security_; |
91 std::string device_path_; | 91 std::string device_path_; |
92 std::string guid_; | 92 std::string guid_; |
93 std::string connection_state_; | 93 std::string connection_state_; |
94 std::string profile_path_; | 94 std::string profile_path_; |
95 std::string error_; | 95 std::string error_; |
96 bool auto_connect_; | 96 bool auto_connect_; |
97 bool favorite_; | 97 bool favorite_; |
98 int priority_; | 98 int priority_; |
| 99 base::DictionaryValue proxy_config_; |
| 100 onc::ONCSource onc_source_; |
99 // IPConfig properties. | 101 // IPConfig properties. |
100 // Note: These do not correspond to actual Shill.Service properties | 102 // Note: These do not correspond to actual Shill.Service properties |
101 // but are derived from the service's corresponding IPConfig object. | 103 // but are derived from the service's corresponding IPConfig object. |
102 std::string ip_address_; | 104 std::string ip_address_; |
103 std::vector<std::string> dns_servers_; | 105 std::vector<std::string> dns_servers_; |
104 // Wireless properties | 106 // Wireless properties |
105 int signal_strength_; | 107 int signal_strength_; |
106 // Wifi properties | 108 // Wifi properties |
107 std::string hex_ssid_; | 109 std::string hex_ssid_; |
108 std::string country_code_; | 110 std::string country_code_; |
109 // Cellular properties | 111 // Cellular properties |
110 std::string technology_; | 112 std::string technology_; |
111 std::string activation_state_; | 113 std::string activation_state_; |
112 std::string roaming_; | 114 std::string roaming_; |
113 bool activate_over_non_cellular_networks_; | 115 bool activate_over_non_cellular_networks_; |
114 bool cellular_out_of_credits_; | 116 bool cellular_out_of_credits_; |
115 | 117 |
116 DISALLOW_COPY_AND_ASSIGN(NetworkState); | 118 DISALLOW_COPY_AND_ASSIGN(NetworkState); |
117 }; | 119 }; |
118 | 120 |
119 } // namespace chromeos | 121 } // namespace chromeos |
120 | 122 |
121 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ | 123 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ |
OLD | NEW |