Index: chromeos/network/network_state.h |
diff --git a/chromeos/network/network_state.h b/chromeos/network/network_state.h |
index 17fa58bca8c2fbbbbeb12571011ad68fe5bbca0e..840bf30d8e1aced5b68a81492038668d46233c44 100644 |
--- a/chromeos/network/network_state.h |
+++ b/chromeos/network/network_state.h |
@@ -10,6 +10,7 @@ |
#include <string> |
#include <vector> |
+#include "base/gtest_prod_util.h" |
#include "base/macros.h" |
#include "base/values.h" |
#include "chromeos/network/managed_state.h" |
@@ -79,8 +80,19 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { |
// Wireless property accessors |
bool connectable() const { return connectable_; } |
+ // For Shill nletwork types, the connectable property is set via an update |
stevenjb
2017/04/19 17:34:17
network
Kyle Horimoto
2017/04/19 19:23:29
Done.
|
+ // from Shill, so SetTetherNetworkConnectable() should not be called in those |
+ // cases. For tether networks, the network is connectable by default, so this |
+ // function should be called when the network is created. |
+ void SetTetherNetworkConnectable(); |
stevenjb
2017/04/19 17:34:17
Generally keep complex methods separate from trivi
Kyle Horimoto
2017/04/19 19:23:29
Done.
|
bool is_captive_portal() const { return is_captive_portal_; } |
int signal_strength() const { return signal_strength_; } |
+ // For Wi-Fi, WiMAX, and cellular networks, signal strength is set via updates |
+ // from Shill, so SetTetherSignalStrength() should not be called in those |
+ // cases. For tether networks, the signal strength is received as a message |
+ // from the tether host over Bluetooth, so it must be set via |
+ // SetTetherSignalStrength() since it does not come from Shill. |
+ void SetTetherSignalStrength(int signal_strength); |
stevenjb
2017/04/19 17:34:17
ditto
Kyle Horimoto
2017/04/19 19:23:29
Done.
|
// Wifi property accessors |
const std::string& eap_method() const { return eap_method_; } |
@@ -102,6 +114,11 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { |
return third_party_vpn_provider_extension_id_; |
} |
+ // Tether accessors and setters. |
+ int battery_percentage() const { return battery_percentage_; } |
+ void SetBatteryPercentage(int battery_percentage); |
stevenjb
2017/04/19 17:34:17
inline, set_battery_percentage()
Kyle Horimoto
2017/04/19 19:23:29
Done.
|
+ const std::string& carrier() const { return carrier_; } |
+ void SetCarrier(const std::string& carrier); |
stevenjb
2017/04/19 17:34:17
inline
Kyle Horimoto
2017/04/19 19:23:29
Done.
|
const std::string& tether_guid() const { return tether_guid_; } |
void set_tether_guid(const std::string& guid) { tether_guid_ = guid; } |
@@ -153,6 +170,7 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { |
friend class MobileActivatorTest; |
friend class NetworkStateHandler; |
friend class NetworkChangeNotifierChromeosUpdateTest; |
+ FRIEND_TEST_ALL_PREFIXES(NetworkStateTest, TetherProperties); |
// Updates |name_| from WiFi.HexSSID if provided, and validates |name_|. |
// Returns true if |name_| changes. |
@@ -213,6 +231,10 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { |
std::string vpn_provider_type_; |
std::string third_party_vpn_provider_extension_id_; |
+ // Tether properties. |
+ std::string carrier_; |
+ int battery_percentage_; |
+ |
// TODO(pneubeck): Remove this once (Managed)NetworkConfigurationHandler |
// provides proxy configuration. crbug.com/241775 |
base::DictionaryValue proxy_config_; |