[CrOS Tether] Update NetworkState to include tether properties and integrate into NetworkStateHandler

Desktop / Chromium - khorimoto [chromium.org] - 20 April 2017 14:48 EDT

This CL: (1) Adds tether properties (battery percentage, carrier, signal strength) to NetworkState. (2) Updates NetworkStateHandler::AddTetherNetworkState() to include parameters for these properties, and adds an UpdateTetherNetworkProperties() function to update these values at a later time. (3) Correctly returns tether networks for NetworkStateHandler's getter functions: ConnectedNetworkByType(), ConnectingNetworkByType(), FirstNetworkByType(), GetNetworkListByType() (4) Updates the tether component's HostScanner to pass tether properties to NetworkStateHandler when scan results come in.

With this CL, the chrome.networkingPrivate API successfully returns tether networks!

BUG=672263 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2819383002 Cr-Commit-Position: refs/heads/master@{#466085}

71c16b9 [CrOS Tether] Update NetworkState to include tether properties and integrate into NetworkStateHandler.
ash/system/network/network_list.cc | 3 +-
.../settings/internet_page/network_summary.js | 4 +-
.../active_host_network_state_updater_unittest.cc | 8 +-
.../tether/host_scan_scheduler_unittest.cc | 4 +-
chromeos/components/tether/host_scanner.cc | 60 +++++++--
chromeos/components/tether/host_scanner.h | 5 +-
.../components/tether/host_scanner_unittest.cc | 22 ++--
chromeos/components/tether/initializer.cc | 2 +-
.../components/tether/tether_connector_unittest.cc | 11 +-
chromeos/network/network_connect_unittest.cc | 6 +-
chromeos/network/network_state.cc | 10 ++
chromeos/network/network_state.h | 17 +++
chromeos/network/network_state_handler.cc | 139 ++++++++++++++++++---
chromeos/network/network_state_handler.h | 52 +++++---
chromeos/network/network_state_handler_unittest.cc | 124 ++++++++++++++----
chromeos/network/network_state_unittest.cc | 26 ++++
16 files changed, 402 insertions(+), 91 deletions(-)

Upstream: git.chromium.org


  • Share