Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: chromeos/network/network_state.h

Issue 2819383002: [CrOS Tether] Update NetworkState to include tether properties and integrate into NetworkStateHandl… (Closed)
Patch Set: Fix comments, add style change, change a LOG to a DCHECK. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/network/network_state.h
diff --git a/chromeos/network/network_state.h b/chromeos/network/network_state.h
index 17fa58bca8c2fbbbbeb12571011ad68fe5bbca0e..5ed132f8205914023cf13f629a3429afd5a5c253 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"
@@ -81,6 +82,12 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState {
bool connectable() const { return connectable_; }
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 SetSignalStrength() should not be called in those cases. For
Ryan Hansberry 2017/04/18 16:08:55 Do you mean to say "SetTetherSignalStrength" here?
Kyle Horimoto 2017/04/18 17:15:23 Yep, good catch. Done.
+ // tether networks, the signal strength is received as a message from the
+ // tether host over Bluetooth, so it must be set via SetSignalStrength()
+ // since it does not come from Shill.
+ void SetTetherSignalStrength(int signal_strength);
// Wifi property accessors
const std::string& eap_method() const { return eap_method_; }
@@ -102,6 +109,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);
+ const std::string& carrier() const { return carrier_; }
+ void SetCarrier(const std::string& carrier);
const std::string& tether_guid() const { return tether_guid_; }
void set_tether_guid(const std::string& guid) { tether_guid_ = guid; }
@@ -153,6 +165,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 +226,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_;

Powered by Google App Engine
This is Rietveld 408576698