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

Side by Side Diff: chrome/browser/chromeos/app_mode/kiosk_app_launch_error.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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" 9 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
10 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 // static 97 // static
98 void KioskAppLaunchError::RecordMetricAndClear() { 98 void KioskAppLaunchError::RecordMetricAndClear() {
99 PrefService* local_state = g_browser_process->local_state(); 99 PrefService* local_state = g_browser_process->local_state();
100 DictionaryPrefUpdate dict_update(local_state, 100 DictionaryPrefUpdate dict_update(local_state,
101 KioskAppManager::kKioskDictionaryName); 101 KioskAppManager::kKioskDictionaryName);
102 102
103 int error; 103 int error;
104 if (dict_update->GetInteger(kKeyLaunchError, &error)) 104 if (dict_update->GetInteger(kKeyLaunchError, &error))
105 UMA_HISTOGRAM_ENUMERATION("Kiosk.Launch.Error", error, ERROR_COUNT); 105 UMA_HISTOGRAM_ENUMERATION("Kiosk.Launch.Error", static_cast<Error>(error),
106 ERROR_COUNT);
106 dict_update->Remove(kKeyLaunchError, NULL); 107 dict_update->Remove(kKeyLaunchError, NULL);
107 108
108 int cryptohome_failure; 109 int cryptohome_failure;
109 if (dict_update->GetInteger(kKeyCryptohomeFailure, &cryptohome_failure)) { 110 if (dict_update->GetInteger(kKeyCryptohomeFailure, &cryptohome_failure)) {
110 UMA_HISTOGRAM_ENUMERATION("Kiosk.Launch.CryptohomeFailure", 111 UMA_HISTOGRAM_ENUMERATION(
111 cryptohome_failure, 112 "Kiosk.Launch.CryptohomeFailure",
112 AuthFailure::NUM_FAILURE_REASONS); 113 static_cast<AuthFailure::FailureReason>(cryptohome_failure),
114 AuthFailure::NUM_FAILURE_REASONS);
113 } 115 }
114 dict_update->Remove(kKeyCryptohomeFailure, NULL); 116 dict_update->Remove(kKeyCryptohomeFailure, NULL);
115 } 117 }
116 118
117 } // namespace chromeos 119 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/captive_portal/captive_portal_service.cc ('k') | chrome/browser/chromeos/login/reauth_stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698