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

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

Issue 385983007: Enrollment recovery: Add UMA stats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix UMA_HISTOGRAM_ENUMERATION() call. Created 6 years, 5 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: chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
index b4b8f02f9f00ed226f9894681e5e5baa259c1989..75488eb1358c4eae4645ccc6f1008f92b856f89d 100644
--- a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_util.h"
#include "base/values.h"
@@ -48,23 +49,12 @@ const char kEnrollmentStepSignin[] = "signin";
const char kEnrollmentStepSuccess[] = "success";
// Enrollment mode strings.
-const char kEnrollmentModeManual[] = "manual";
-const char kEnrollmentModeForced[] = "forced";
-const char kEnrollmentModeAuto[] = "auto";
+const char* const kModeStrings[EnrollmentScreenActor::ENROLLMENT_MODE_COUNT] =
+ { "manual", "forced", "auto", "recovery" };
std::string EnrollmentModeToString(EnrollmentScreenActor::EnrollmentMode mode) {
- switch (mode) {
- case EnrollmentScreenActor::ENROLLMENT_MODE_MANUAL:
- return kEnrollmentModeManual;
- case EnrollmentScreenActor::ENROLLMENT_MODE_FORCED:
- return kEnrollmentModeForced;
- case EnrollmentScreenActor::ENROLLMENT_MODE_AUTO:
- return kEnrollmentModeAuto;
- default:
- NOTREACHED() << "Bad enrollment mode " << mode;
- }
-
- return kEnrollmentModeManual;
+ CHECK(0 <= mode && mode < EnrollmentScreenActor::ENROLLMENT_MODE_COUNT);
+ return kModeStrings[mode];
}
// A helper class that takes care of asynchronously revoking a given token.

Powered by Google App Engine
This is Rietveld 408576698