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

Unified Diff: chromeos/network/network_state_handler.h

Issue 2819993002: [CrOS Tether] Add the notion of a tether DeviceState. (Closed)
Patch Set: Rebased. 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 3265b00141c167c6fb162db3ff6a8bcd7cd1ba88..23c4cd09e0feb197ccdb27bec2e080b7b5ba5402 100644
--- a/chromeos/network/network_state_handler.h
+++ b/chromeos/network/network_state_handler.h
@@ -112,6 +112,17 @@ class CHROMEOS_EXPORT NetworkStateHandler
bool enabled,
const network_handler::ErrorCallback& error_callback);
+ // Sets the tether technology state. Because tether networks do not represent
Ryan Hansberry 2017/04/20 01:38:35 Please refer to as "Tether" throughout documentati
Kyle Horimoto 2017/04/20 02:16:08 Done.
+ // real Shill networks, this value must be set by the tether component rather
+ // than being generated by Shill. See TetherDeviceStateManager for more
+ // details.
+ void SetTetherTechnologyState(TechnologyState technology_state);
+
+ // Sets the scanning state of the tether technology. Since tether network
+ // scans are not actually performed as part of Shill, this value must be set
+ // by the tether component.
+ void SetTetherScanState(bool is_scanning);
+
// Asynchronously sets the list of prohibited technologies. The accepted
// values are the shill network technology identifiers. See also
// chromeos::onc::Validator::ValidateGlobalNetworkConfiguration().
@@ -250,7 +261,11 @@ class CHROMEOS_EXPORT NetworkStateHandler
DeviceStateList* list) const;
// Requests a network scan. This may trigger updates to the network
- // list, which will trigger the appropriate observer calls.
+ // list, which will trigger the appropriate observer calls. Note that this
+ // function does not request a tether scan.
+ // TODO(khorimoto): Add an also_scan_for_tether parameter. Tether scans should
+ // not occur during start-up, but they should occur when opening networking
+ // UI.
void RequestScan() const;
// Requests an update for an existing NetworkState, e.g. after configuring
@@ -259,7 +274,8 @@ class CHROMEOS_EXPORT NetworkStateHandler
// acknowledged it (e.g. in the callback of a SetProperties).
// When the properties are received, NetworkPropertiesUpdated will be
// signaled for each member of |observers_|, regardless of whether any
- // properties actually changed.
+ // properties actually changed. Note that this is a no-op for tether networks.
+ // TODO(khorimoto): Add network update functionality for tether networks.
Ryan Hansberry 2017/04/20 01:38:35 Why will we need this for Tether?
Kyle Horimoto 2017/04/20 02:16:08 We don't actually - you're right.
void RequestUpdateForNetwork(const std::string& service_path);
// Informs NetworkStateHandler to notify observers that the properties for
@@ -482,6 +498,11 @@ class CHROMEOS_EXPORT NetworkStateHandler
// NetworkState that is not saved in a profile.
SpecifierGuidMap specifier_guid_map_;
+ // The state corresponding to the tether device type. Initialized to
+ // PROHIBITED; this value is changed by the tether component when it starts
+ // up.
+ TechnologyState tether_state_ = TechnologyState::TECHNOLOGY_PROHIBITED;
Ryan Hansberry 2017/04/20 01:38:35 nit: tether_technology_state_
Ryan Hansberry 2017/04/20 01:38:35 I think a better default may be unavailable.
Kyle Horimoto 2017/04/20 02:16:08 Done.
Kyle Horimoto 2017/04/20 02:16:08 No, PROHIBITED makes more sense. This should only
+
// Ensure that Shutdown() gets called exactly once.
bool did_shutdown_ = false;

Powered by Google App Engine
This is Rietveld 408576698