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

Unified Diff: chromeos/network/network_state_handler.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_handler.h
diff --git a/chromeos/network/network_state_handler.h b/chromeos/network/network_state_handler.h
index 34bac738572f970ef44d7156d1aaa3b870bca3f7..33758345cf281ea16c831d3ae31e8779adb4cbb5 100644
--- a/chromeos/network/network_state_handler.h
+++ b/chromeos/network/network_state_handler.h
@@ -208,20 +208,32 @@ class CHROMEOS_EXPORT NetworkStateHandler
// refer to and fetch this NetworkState in the future.
// NOTE: only GetNetworkStateFromGuid is supported to fetch "tether"
// NetworkStates.
- void AddTetherNetworkState(const std::string& guid, const std::string& name);
+ void AddTetherNetworkState(const std::string& guid,
+ const std::string& name,
+ const std::string& carrier,
+ int battery_percentage,
+ int signal_strength);
+
+ // Updates the tether properties (carrier, battery percentage, and signal
+ // strength) for a network which has already been added via
+ // AddTetherNetworkState. Returns whether the update was successful.
+ bool UpdateTetherNetworkProperties(const std::string& guid,
+ const std::string& carrier,
+ int battery_percentage,
+ int signal_strength);
// Remove a Tether NetworkState, using the same |guid| passed to
// AddTetherNetworkState.
void RemoveTetherNetworkState(const std::string& guid);
// Inform NetworkStateHandler that the provided Tether network with the
- // provided guid |tether_guid| is associated with the Wi-Fi network with the
- // provided guid |wifi_ssid|. This Wi-Fi network can now be hidden in the UI,
- // and the Tether network will act as its proxy. Returns false if the
- // association failed (e.g. one or both networks don't exist).
+ // provided guid |tether_network_guid| is associated with the Wi-Fi network
+ // with the provided guid |wifi_network_guid|. This Wi-Fi network can now be
+ // hidden in the UI, and the Tether network will act as its proxy. Returns
+ // false if the association failed (i.e., one or both networks don't exist).
Ryan Hansberry 2017/04/18 16:08:55 super nit: because this only describes one possibl
Kyle Horimoto 2017/04/18 17:15:23 Done.
bool AssociateTetherNetworkStateWithWifiNetwork(
const std::string& tether_network_guid,
- const std::string& wifi_network_ssid);
+ const std::string& wifi_network_guid);
// Set the connection_state of the Tether NetworkState corresponding to the
// provided |guid| to "Disconnected". This will be reflected in the UI.
@@ -434,6 +446,12 @@ class CHROMEOS_EXPORT NetworkStateHandler
std::vector<std::string> GetTechnologiesForType(
const NetworkTypePattern& type) const;
+ // Set the connection_state of a Tether NetworkState corresponding to the
Ryan Hansberry 2017/04/18 16:08:55 Why did you move this?
Kyle Horimoto 2017/04/18 17:15:23 All function declarations should be before all pri
+ // provided |guid|.
+ void SetTetherNetworkStateConnectionState(
+ const std::string& guid,
+ const std::string& connection_state);
+
// Shill property handler instance, owned by this class.
std::unique_ptr<internal::ShillPropertyHandler> shill_property_handler_;
@@ -467,12 +485,6 @@ class CHROMEOS_EXPORT NetworkStateHandler
// Ensure that Shutdown() gets called exactly once.
bool did_shutdown_ = false;
- // Set the |connection_state| of a Tether NetworkState corresponding to the
- // provided |guid|.
- void SetTetherNetworkStateConnectionState(
- const std::string& guid,
- const std::string& connection_state);
-
DISALLOW_COPY_AND_ASSIGN(NetworkStateHandler);
};

Powered by Google App Engine
This is Rietveld 408576698