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

Unified Diff: chromeos/network/network_state_handler.h

Issue 2850993002: [CrOS Tether] Add the HasConnectedToHost network field to NetworkStateHandler. (Closed)
Patch Set: stevenjb@ comments. 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_connection_handler_unittest.cc ('k') | chromeos/network/network_state_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_state_handler.h
diff --git a/chromeos/network/network_state_handler.h b/chromeos/network/network_state_handler.h
index b35887bd5aa6f0629d9fa06fe540d20476548414..419d98d7925a27f7b73e20d9feceddc1cf03b0ae 100644
--- a/chromeos/network/network_state_handler.h
+++ b/chromeos/network/network_state_handler.h
@@ -208,14 +208,16 @@ class CHROMEOS_EXPORT NetworkStateHandler
// service. When initially created, it does not actually represent a real
// network. The |guid| provided must be non-empty. If a network with |guid|
// already exists, this method will do nothing. Use the provided |guid| to
- // refer to and fetch this NetworkState in the future.
- // NOTE: only GetNetworkStateFromGuid is supported to fetch "tether"
- // NetworkStates.
+ // refer to and fetch this NetworkState in the future. Note that the
+ // |has_connected_to_host| parameter refers to whether the current device has
+ // already connected to the tether host device providing this Tether network
+ // in the past.
void AddTetherNetworkState(const std::string& guid,
const std::string& name,
const std::string& carrier,
int battery_percentage,
- int signal_strength);
+ int signal_strength,
+ bool has_connected_to_host);
// Updates the tether properties (carrier, battery percentage, and signal
// strength) for a network which has already been added via
@@ -225,9 +227,18 @@ class CHROMEOS_EXPORT NetworkStateHandler
int battery_percentage,
int signal_strength);
+ // Updates whether the Tether network with GUID |guid| has connected to the
+ // host device before, setting the value to true. Note that there is no way to
+ // change this value back to false. If no network with GUID |guid| is
+ // registered or if the network is registered and its HasConnectedToHost value
+ // was already true, this function does nothing. Returns whether the value was
+ // actually changed.
+ bool SetTetherNetworkHasConnectedToHost(const std::string& guid);
+
// Remove a Tether NetworkState, using the same |guid| passed to
- // AddTetherNetworkState.
- void RemoveTetherNetworkState(const std::string& guid);
+ // AddTetherNetworkState(). If no network with GUID |guid| is registered, this
+ // function does nothing. Returns whether the network was actually removed.
+ bool RemoveTetherNetworkState(const std::string& guid);
// Inform NetworkStateHandler that the provided Tether network with the
// provided guid |tether_network_guid| is associated with the Wi-Fi network
« no previous file with comments | « chromeos/network/network_connection_handler_unittest.cc ('k') | chromeos/network/network_state_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698