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

Unified Diff: chromeos/network/network_state.h

Issue 2819383002: [CrOS Tether] Update NetworkState to include tether properties and integrate into NetworkStateHandl… (Closed)
Patch Set: stevenjb@ comment. 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
« no previous file with comments | « chromeos/network/network_connect_unittest.cc ('k') | chromeos/network/network_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_state.h
diff --git a/chromeos/network/network_state.h b/chromeos/network/network_state.h
index 17fa58bca8c2fbbbbeb12571011ad68fe5bbca0e..995207d3f3473da9a479eb518e4b17e46a7e0dbb 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,12 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState {
// Wireless property accessors
bool connectable() const { return connectable_; }
+ void set_connectable(bool connectable) { connectable_ = connectable; }
bool is_captive_portal() const { return is_captive_portal_; }
int signal_strength() const { return signal_strength_; }
+ void set_signal_strength(int signal_strength) {
+ signal_strength_ = signal_strength;
+ }
// Wifi property accessors
const std::string& eap_method() const { return eap_method_; }
@@ -102,6 +107,13 @@ 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 set_battery_percentage(int battery_percentage) {
+ battery_percentage_ = battery_percentage;
+ }
+ const std::string& carrier() const { return carrier_; }
+ void set_carrier(const std::string& carrier) { carrier_ = 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_;
« no previous file with comments | « chromeos/network/network_connect_unittest.cc ('k') | chromeos/network/network_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698