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

Unified Diff: chrome/browser/policy/enterprise_metrics.cc

Issue 7105018: UMA metrics for cloud policies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed detection of some events, rebased Created 9 years, 6 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/policy/enterprise_metrics.cc
diff --git a/chrome/browser/policy/enterprise_metrics.cc b/chrome/browser/policy/enterprise_metrics.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ab8f2543811f7a5d0f95c4dbef44356387db62c0
--- /dev/null
+++ b/chrome/browser/policy/enterprise_metrics.cc
@@ -0,0 +1,52 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/metrics/histogram.h"
+#include "chrome/browser/policy/enterprise_metrics.h"
+#include "content/browser/browser_thread.h"
+
+namespace enterprise_management {
+
+void LogTokenOperation(TokenOperationResult result) {
+ DCHECK(result >= 0);
+ DCHECK(result < kTokenOperationsSize);
+
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
gfeher 2011/06/28 09:58:58 Are you sure this is necessary? I haven't seen thi
Joao da Silva 2011/06/30 12:57:00 After checking histogram.h it seems to me that ini
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ NewRunnableFunction(&LogTokenOperation, result));
+ return;
+ }
+
+ UMA_HISTOGRAM_ENUMERATION("Enterprise.DMToken", result, kTokenOperationsSize);
+}
+
+void LogPolicyOperation(PolicyOperationResult result) {
+ DCHECK(result >= 0);
+ DCHECK(result < kPolicyOperationsSize);
+
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ NewRunnableFunction(&LogPolicyOperation, result));
+ return;
+ }
+
+ UMA_HISTOGRAM_ENUMERATION("Enterprise.Policy", result, kPolicyOperationsSize);
+}
+
+void LogEnrollmentOperation(EnrollmentResult result) {
+ DCHECK(result >= 0);
+ DCHECK(result < kEnrollmentOperationsSize);
+
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableFunction(&LogEnrollmentOperation, result));
+ return;
+ }
+
+ UMA_HISTOGRAM_ENUMERATION("Enterprise.Enrollment", result,
+ kEnrollmentOperationsSize);
+}
+
+} // namespace enterprise_management

Powered by Google App Engine
This is Rietveld 408576698