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

Unified Diff: chrome/browser/chromeos/login/screens/reset_screen.cc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: simplify type checking Created 3 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
« no previous file with comments | « chrome/browser/chromeos/login/reauth_stats.cc ('k') | chrome/browser/chromeos/policy/upload_job_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/screens/reset_screen.cc
diff --git a/chrome/browser/chromeos/login/screens/reset_screen.cc b/chrome/browser/chromeos/login/screens/reset_screen.cc
index 0d92393d2f540cde22fd7ca8dd751a62156efc37..cfe248947120144242e865aa924f3dacabeb55ec 100644
--- a/chrome/browser/chromeos/login/screens/reset_screen.cc
+++ b/chrome/browser/chromeos/login/screens/reset_screen.cc
@@ -72,7 +72,8 @@ void ResetScreen::Show() {
if (view_)
view_->Show();
- int dialog_type = -1; // used by UMA metrics.
+ reset::DialogViewType dialog_type =
+ reset::DIALOG_VIEW_TYPE_SIZE; // used by UMA metrics.
ContextEditor context_editor = GetContextEditor();
@@ -96,7 +97,7 @@ void ResetScreen::Show() {
weak_ptr_factory_.GetWeakPtr()));
}
- if (dialog_type >= 0) {
+ if (dialog_type < reset::DIALOG_VIEW_TYPE_SIZE) {
UMA_HISTOGRAM_ENUMERATION("Reset.ChromeOS.PowerwashDialogShown",
dialog_type,
reset::DIALOG_VIEW_TYPE_SIZE);
@@ -204,9 +205,10 @@ void ResetScreen::OnToggleRollback() {
}
void ResetScreen::OnShowConfirm() {
- int dialog_type = context_.GetBoolean(kContextKeyIsRollbackChecked) ?
- reset::DIALOG_SHORTCUT_CONFIRMING_POWERWASH_AND_ROLLBACK :
- reset::DIALOG_SHORTCUT_CONFIRMING_POWERWASH_ONLY;
+ reset::DialogViewType dialog_type =
+ context_.GetBoolean(kContextKeyIsRollbackChecked)
+ ? reset::DIALOG_SHORTCUT_CONFIRMING_POWERWASH_AND_ROLLBACK
+ : reset::DIALOG_SHORTCUT_CONFIRMING_POWERWASH_ONLY;
UMA_HISTOGRAM_ENUMERATION(
"Reset.ChromeOS.PowerwashDialogShown",
dialog_type,
@@ -249,9 +251,9 @@ void ResetScreen::UpdateStatusChanged(
// Invoked from call to CanRollbackCheck upon completion of the DBus call.
void ResetScreen::OnRollbackCheck(bool can_rollback) {
VLOG(1) << "Callback from CanRollbackCheck, result " << can_rollback;
- int dialog_type = can_rollback ?
- reset::DIALOG_SHORTCUT_OFFERING_ROLLBACK_AVAILABLE :
- reset::DIALOG_SHORTCUT_OFFERING_ROLLBACK_UNAVAILABLE;
+ reset::DialogViewType dialog_type =
+ can_rollback ? reset::DIALOG_SHORTCUT_OFFERING_ROLLBACK_AVAILABLE
+ : reset::DIALOG_SHORTCUT_OFFERING_ROLLBACK_UNAVAILABLE;
UMA_HISTOGRAM_ENUMERATION("Reset.ChromeOS.PowerwashDialogShown",
dialog_type,
reset::DIALOG_VIEW_TYPE_SIZE);
« no previous file with comments | « chrome/browser/chromeos/login/reauth_stats.cc ('k') | chrome/browser/chromeos/policy/upload_job_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698