| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 // Cellular property accessors | 94 // Cellular property accessors |
| 95 const std::string& network_technology() const { | 95 const std::string& network_technology() const { |
| 96 return network_technology_; | 96 return network_technology_; |
| 97 } | 97 } |
| 98 const std::string& activation_type() const { return activation_type_; } | 98 const std::string& activation_type() const { return activation_type_; } |
| 99 const std::string& activation_state() const { return activation_state_; } | 99 const std::string& activation_state() const { return activation_state_; } |
| 100 const std::string& roaming() const { return roaming_; } | 100 const std::string& roaming() const { return roaming_; } |
| 101 const std::string& payment_url() const { return payment_url_; } | 101 const std::string& payment_url() const { return payment_url_; } |
| 102 bool cellular_out_of_credits() const { return cellular_out_of_credits_; } | 102 bool cellular_out_of_credits() const { return cellular_out_of_credits_; } |
| 103 const std::string& tethering_state() const { return tethering_state_; } |
| 103 | 104 |
| 104 // VPN property accessors | 105 // VPN property accessors |
| 105 const std::string& vpn_provider_type() const { return vpn_provider_type_; } | 106 const std::string& vpn_provider_type() const { return vpn_provider_type_; } |
| 106 const std::string& third_party_vpn_provider_extension_id() const { | 107 const std::string& third_party_vpn_provider_extension_id() const { |
| 107 return third_party_vpn_provider_extension_id_; | 108 return third_party_vpn_provider_extension_id_; |
| 108 } | 109 } |
| 109 | 110 |
| 110 // Tether accessors and setters. | 111 // Tether accessors and setters. |
| 111 int battery_percentage() const { return battery_percentage_; } | 112 int battery_percentage() const { return battery_percentage_; } |
| 112 void set_battery_percentage(int battery_percentage) { | 113 void set_battery_percentage(int battery_percentage) { |
| 113 battery_percentage_ = battery_percentage; | 114 battery_percentage_ = battery_percentage; |
| 114 } | 115 } |
| 115 const std::string& carrier() const { return carrier_; } | 116 const std::string& carrier() const { return carrier_; } |
| 116 void set_carrier(const std::string& carrier) { carrier_ = carrier; } | 117 void set_carrier(const std::string& carrier) { carrier_ = carrier; } |
| 117 bool tether_has_connected_to_host() const { | 118 bool tether_has_connected_to_host() const { |
| 118 return tether_has_connected_to_host_; | 119 return tether_has_connected_to_host_; |
| 119 } | 120 } |
| 120 void set_tether_has_connected_to_host(bool tether_has_connected_to_host) { | 121 void set_tether_has_connected_to_host(bool tether_has_connected_to_host) { |
| 121 tether_has_connected_to_host_ = tether_has_connected_to_host; | 122 tether_has_connected_to_host_ = tether_has_connected_to_host; |
| 122 } | 123 } |
| 123 const std::string& tether_guid() const { return tether_guid_; } | 124 const std::string& tether_guid() const { return tether_guid_; } |
| 124 void set_tether_guid(const std::string& guid) { tether_guid_ = guid; } | 125 void set_tether_guid(const std::string& guid) { tether_guid_ = guid; } |
| 125 | 126 |
| 127 // Returns true if current connection is using mobile data. |
| 128 bool IsUsingMobileData() const; |
| 129 |
| 126 // Returns true if the network securty is WEP_8021x (Dynamic WEP) | 130 // Returns true if the network securty is WEP_8021x (Dynamic WEP) |
| 127 bool IsDynamicWep() const; | 131 bool IsDynamicWep() const; |
| 128 | 132 |
| 129 // Returns true if |connection_state_| is a connected/connecting state. | 133 // Returns true if |connection_state_| is a connected/connecting state. |
| 130 bool IsConnectedState() const; | 134 bool IsConnectedState() const; |
| 131 bool IsConnectingState() const; | 135 bool IsConnectingState() const; |
| 132 | 136 |
| 133 // Returns true if |last_connection_state_| is connected, and | 137 // Returns true if |last_connection_state_| is connected, and |
| 134 // |connection_state_| is connecting. | 138 // |connection_state_| is connecting. |
| 135 bool IsReconnecting() const; | 139 bool IsReconnecting() const; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 std::string bssid_; // For ARC | 223 std::string bssid_; // For ARC |
| 220 int frequency_ = 0; // For ARC | 224 int frequency_ = 0; // For ARC |
| 221 | 225 |
| 222 // Cellular properties, used for icons, Connect, and Activation. | 226 // Cellular properties, used for icons, Connect, and Activation. |
| 223 std::string network_technology_; | 227 std::string network_technology_; |
| 224 std::string activation_type_; | 228 std::string activation_type_; |
| 225 std::string activation_state_; | 229 std::string activation_state_; |
| 226 std::string roaming_; | 230 std::string roaming_; |
| 227 std::string payment_url_; | 231 std::string payment_url_; |
| 228 bool cellular_out_of_credits_ = false; | 232 bool cellular_out_of_credits_ = false; |
| 233 std::string tethering_state_; |
| 229 | 234 |
| 230 // VPN properties, used to construct the display name and to show the correct | 235 // VPN properties, used to construct the display name and to show the correct |
| 231 // configuration dialog. | 236 // configuration dialog. |
| 232 std::string vpn_provider_type_; | 237 std::string vpn_provider_type_; |
| 233 std::string third_party_vpn_provider_extension_id_; | 238 std::string third_party_vpn_provider_extension_id_; |
| 234 | 239 |
| 235 // Tether properties. | 240 // Tether properties. |
| 236 std::string carrier_; | 241 std::string carrier_; |
| 237 int battery_percentage_; | 242 int battery_percentage_; |
| 243 |
| 238 // Whether the current device has already connected to the tether host device | 244 // Whether the current device has already connected to the tether host device |
| 239 // providing the hotspot corresponding to this NetworkState. | 245 // providing the hotspot corresponding to this NetworkState. |
| 240 // Note: this means that the current device has already connected to the | 246 // Note: this means that the current device has already connected to the |
| 241 // tether host, but it does not necessarily mean that the current device has | 247 // tether host, but it does not necessarily mean that the current device has |
| 242 // connected to the Tether network corresponding to this NetworkState. | 248 // connected to the Tether network corresponding to this NetworkState. |
| 243 bool tether_has_connected_to_host_; | 249 bool tether_has_connected_to_host_; |
| 244 | 250 |
| 245 // TODO(pneubeck): Remove this once (Managed)NetworkConfigurationHandler | 251 // TODO(pneubeck): Remove this once (Managed)NetworkConfigurationHandler |
| 246 // provides proxy configuration. crbug.com/241775 | 252 // provides proxy configuration. crbug.com/241775 |
| 247 base::DictionaryValue proxy_config_; | 253 base::DictionaryValue proxy_config_; |
| 248 | 254 |
| 249 DISALLOW_COPY_AND_ASSIGN(NetworkState); | 255 DISALLOW_COPY_AND_ASSIGN(NetworkState); |
| 250 }; | 256 }; |
| 251 | 257 |
| 252 } // namespace chromeos | 258 } // namespace chromeos |
| 253 | 259 |
| 254 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ | 260 #endif // CHROMEOS_NETWORK_NETWORK_STATE_H_ |
| OLD | NEW |