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

Unified Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc

Issue 12211111: Added UMA records for OOBE portal detection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync, fix. Created 7 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 | « chrome/browser/chromeos/net/network_portal_detector.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
index f5cdc76930836b3dc8e332969a4dc2f8fec7cc16..dd15bd21a362ad0824762de9486e2cde0ea9d6e0 100644
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -9,6 +9,7 @@
#include "base/callback.h"
#include "base/command_line.h"
#include "base/logging.h"
+#include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h"
#include "base/string16.h"
#include "base/string_util.h"
@@ -195,6 +196,69 @@ NetworkPortalDetector::CaptivePortalState GetCaptivePortalState(
return detector->GetCaptivePortalState(network);
}
+void RecordDiscrepancyWithShill(
+ const Network* network,
+ const NetworkPortalDetector::CaptivePortalStatus status) {
+ if (network->online()) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "CaptivePortal.OOBE.DiscrepancyWithShill.Online",
+ status,
+ NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT);
+ } else if (network->restricted_pool()) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "CaptivePortal.OOBE.DiscrepancyWithShill.RestrictedPool",
+ status,
+ NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION(
+ "CaptivePortal.OOBE.DiscrepancyWithShill.Offline",
+ status,
+ NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT);
+ }
+}
+
+// Record state and descripancies with shill (e.g. shill thinks that
+// network is online but NetworkPortalDetector claims that it's behind
+// portal) for the network identified by |service_path|.
+void RecordNetworkPortalDetectorStats(const std::string& service_path) {
+ const Network* network = FindNetworkByPath(service_path);
+ if (!network)
+ return;
+ NetworkPortalDetector::CaptivePortalState state =
+ GetCaptivePortalState(service_path);
+ if (state.status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN)
+ return;
+
+ UMA_HISTOGRAM_ENUMERATION("CaptivePortal.OOBE.DetectionResult",
+ state.status,
+ NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT);
+
+ switch (state.status) {
+ case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN:
+ NOTREACHED();
+ break;
+ case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE:
+ if (network->online() || network->restricted_pool())
+ RecordDiscrepancyWithShill(network, state.status);
+ break;
+ case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE:
+ if (!network->online())
+ RecordDiscrepancyWithShill(network, state.status);
+ break;
+ case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL:
+ if (!network->restricted_pool())
+ RecordDiscrepancyWithShill(network, state.status);
+ break;
+ case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED:
+ if (!network->online())
+ RecordDiscrepancyWithShill(network, state.status);
+ break;
+ case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT:
+ NOTREACHED();
+ break;
+ }
+}
+
} // namespace
// SigninScreenHandler implementation ------------------------------------------
@@ -552,6 +616,11 @@ void SigninScreenHandler::UpdateStateInternal(
<< "network_id=" << network_id << ", "
<< "reason=" << reason << ", "
<< "is_under_captive_portal=" << is_under_captive_portal;
+
+ // Record portal detection stats only if we're going to show or
+ // change state of the error screen.
+ RecordNetworkPortalDetectorStats(service_path);
+
if (is_proxy_error) {
error_screen_actor_->ShowProxyError();
} else if (is_under_captive_portal) {
« no previous file with comments | « chrome/browser/chromeos/net/network_portal_detector.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698