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 "base/values.h" |
12 #include "chromeos/network/managed_state.h" | 12 #include "chromeos/network/managed_state.h" |
13 #include "chromeos/network/network_ui_data.h" | |
14 #include "components/onc/onc_constants.h" | 13 #include "components/onc/onc_constants.h" |
15 #include "url/gurl.h" | 14 #include "url/gurl.h" |
16 | 15 |
17 namespace base { | 16 namespace base { |
18 class DictionaryValue; | 17 class DictionaryValue; |
19 class Value; | 18 class Value; |
20 } | 19 } |
21 | 20 |
22 namespace chromeos { | 21 namespace chromeos { |
23 | 22 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 const std::string& device_path() const { return device_path_; } | 55 const std::string& device_path() const { return device_path_; } |
57 const std::string& guid() const { return guid_; } | 56 const std::string& guid() const { return guid_; } |
58 const std::string& profile_path() const { return profile_path_; } | 57 const std::string& profile_path() const { return profile_path_; } |
59 const std::string& error() const { return error_; } | 58 const std::string& error() const { return error_; } |
60 const std::string& last_error() const { return last_error_; } | 59 const std::string& last_error() const { return last_error_; } |
61 void clear_last_error() { last_error_.clear(); } | 60 void clear_last_error() { last_error_.clear(); } |
62 | 61 |
63 // Returns |connection_state_| if visible, kStateDisconnect otherwise. | 62 // Returns |connection_state_| if visible, kStateDisconnect otherwise. |
64 std::string connection_state() const; | 63 std::string connection_state() const; |
65 | 64 |
66 const NetworkUIData& ui_data() const { return ui_data_; } | |
67 const base::DictionaryValue& proxy_config() const { return proxy_config_; } | 65 const base::DictionaryValue& proxy_config() const { return proxy_config_; } |
68 | 66 |
69 // IPConfig Properties. These require an extra call to ShillIPConfigClient, | 67 // IPConfig Properties. These require an extra call to ShillIPConfigClient, |
70 // so cache them to avoid excessively complex client code. | 68 // so cache them to avoid excessively complex client code. |
71 const std::string& ip_address() const { return ip_address_; } | 69 const std::string& ip_address() const { return ip_address_; } |
72 const std::string& gateway() const { return gateway_; } | 70 const std::string& gateway() const { return gateway_; } |
73 const std::vector<std::string>& dns_servers() const { return dns_servers_; } | 71 const std::vector<std::string>& dns_servers() const { return dns_servers_; } |
74 const GURL& web_proxy_auto_discovery_url() const { | 72 const GURL& web_proxy_auto_discovery_url() const { |
75 return web_proxy_auto_discovery_url_; | 73 return web_proxy_auto_discovery_url_; |
76 } | 74 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 bool connectable_; | 147 bool connectable_; |
150 | 148 |
151 // Reflects the current Shill Service.Error property. This might get cleared | 149 // Reflects the current Shill Service.Error property. This might get cleared |
152 // by Shill shortly after a failure. | 150 // by Shill shortly after a failure. |
153 std::string error_; | 151 std::string error_; |
154 | 152 |
155 // Last non empty Service.Error property. Cleared by NetworkConnectionHandler | 153 // Last non empty Service.Error property. Cleared by NetworkConnectionHandler |
156 // when a connection attempt is initiated. | 154 // when a connection attempt is initiated. |
157 std::string last_error_; | 155 std::string last_error_; |
158 | 156 |
159 // This is convenient to keep cached for now, but shouldn't be necessary; | |
160 // avoid using it if possible. | |
161 NetworkUIData ui_data_; | |
162 | |
163 // IPConfig properties. | 157 // IPConfig properties. |
164 // Note: These do not correspond to actual Shill.Service properties | 158 // Note: These do not correspond to actual Shill.Service properties |
165 // but are derived from the service's corresponding IPConfig object. | 159 // but are derived from the service's corresponding IPConfig object. |
166 std::string ip_address_; | 160 std::string ip_address_; |
167 std::string gateway_; | 161 std::string gateway_; |
168 std::vector<std::string> dns_servers_; | 162 std::vector<std::string> dns_servers_; |
169 int prefix_length_; // Used by GetNetmask() | 163 int prefix_length_; // Used by GetNetmask() |
170 GURL web_proxy_auto_discovery_url_; | 164 GURL web_proxy_auto_discovery_url_; |
171 | 165 |
172 // Wireless properties, used for icons and Connect logic. | 166 // Wireless properties, used for icons and Connect logic. |
(...skipping 13 matching lines...) Expand all Loading... |
186 // TODO(pneubeck): Remove this once (Managed)NetworkConfigurationHandler | 180 // TODO(pneubeck): Remove this once (Managed)NetworkConfigurationHandler |
187 // provides proxy configuration. crbug.com/241775 | 181 // provides proxy configuration. crbug.com/241775 |
188 base::DictionaryValue proxy_config_; | 182 base::DictionaryValue proxy_config_; |
189 | 183 |
190 DISALLOW_COPY_AND_ASSIGN(NetworkState); | 184 DISALLOW_COPY_AND_ASSIGN(NetworkState); |
191 }; | 185 }; |
192 | 186 |
193 } // namespace chromeos | 187 } // namespace chromeos |
194 | 188 |
195 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ | 189 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ |
OLD | NEW |