Index: chromeos/components/tether/wifi_hotspot_connector.cc |
diff --git a/chromeos/components/tether/wifi_hotspot_connector.cc b/chromeos/components/tether/wifi_hotspot_connector.cc |
index d67bb76b538fb58ebc75f856be87697bf25fa47b..0bfbda751cf7e255058139082c2f2daa725cc4c2 100644 |
--- a/chromeos/components/tether/wifi_hotspot_connector.cc |
+++ b/chromeos/components/tether/wifi_hotspot_connector.cc |
@@ -7,6 +7,7 @@ |
#include "base/bind.h" |
#include "base/guid.h" |
#include "base/memory/ptr_util.h" |
+#include "chromeos/components/tether/host_connection_metrics_logger.h" |
#include "chromeos/network/network_connect.h" |
#include "chromeos/network/network_handler.h" |
#include "chromeos/network/network_state.h" |
@@ -21,9 +22,11 @@ namespace tether { |
WifiHotspotConnector::WifiHotspotConnector( |
NetworkStateHandler* network_state_handler, |
- NetworkConnect* network_connect) |
+ NetworkConnect* network_connect, |
+ HostConnectionMetricsLogger* host_connection_metrics_logger) |
: network_state_handler_(network_state_handler), |
network_connect_(network_connect), |
+ host_connection_metrics_logger_(host_connection_metrics_logger), |
timer_(base::MakeUnique<base::OneShotTimer>()), |
weak_ptr_factory_(this) { |
network_state_handler_->AddObserver(this, FROM_HERE); |
@@ -62,6 +65,10 @@ void WifiHotspotConnector::ConnectToWifiHotspot( |
} |
InvokeWifiConnectionCallback(std::string()); |
+ |
+ host_connection_metrics_logger_->RecordConnectionToHostResult( |
+ HostConnectionMetricsLogger::ConnectionToHostResult:: |
+ CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_CANCELED_BY_NEW_ATTEMPT); |
} |
ssid_ = ssid; |
@@ -176,6 +183,10 @@ base::DictionaryValue WifiHotspotConnector::CreateWifiPropertyDictionary( |
void WifiHotspotConnector::OnConnectionTimeout() { |
InvokeWifiConnectionCallback(std::string()); |
+ |
+ host_connection_metrics_logger_->RecordConnectionToHostResult( |
+ HostConnectionMetricsLogger::ConnectionToHostResult:: |
+ CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_TIMEOUT); |
} |
void WifiHotspotConnector::SetTimerForTest(std::unique_ptr<base::Timer> timer) { |