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

Unified Diff: components/metrics/net/network_metrics_provider.cc

Issue 922383003: Enable UMA log uploads for cellular networks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments fixed Created 5 years, 10 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 | « components/metrics/net/network_metrics_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/net/network_metrics_provider.cc
diff --git a/components/metrics/net/network_metrics_provider.cc b/components/metrics/net/network_metrics_provider.cc
index e845cde5bd511a69bccd4ec4a3f6c5e956bebe17..4ec657435a60e2d5b4e3516cce826d2d42d39dad 100644
--- a/components/metrics/net/network_metrics_provider.cc
+++ b/components/metrics/net/network_metrics_provider.cc
@@ -227,4 +227,24 @@ void NetworkMetricsProvider::WriteWifiAccessPointProto(
}
}
+bool NetworkMetricsProvider::IsCellularConnection() {
+ switch (GetConnectionType()) {
+ case SystemProfileProto_Network_ConnectionType_CONNECTION_2G:
+ case SystemProfileProto_Network_ConnectionType_CONNECTION_3G:
+ case SystemProfileProto_Network_ConnectionType_CONNECTION_4G:
+ return true;
+ default:
+ return false;
+ }
+}
+
+void NetworkMetricsProvider::GetIsCellularConnection(bool* is_cellular_out) {
+ *is_cellular_out = IsCellularConnection();
+}
+
+base::Callback<void(bool*)> NetworkMetricsProvider::GetConnectionCallback() {
+ return base::Bind(&NetworkMetricsProvider::GetIsCellularConnection,
+ weak_ptr_factory_.GetWeakPtr());
+}
+
} // namespace metrics
« no previous file with comments | « components/metrics/net/network_metrics_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698