Index: chrome/browser/jumplist_metrics.cc |
diff --git a/chrome/browser/jumplist_metrics.cc b/chrome/browser/jumplist_metrics.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e509d9d4173dd61d4f5aa7d213f771f40914f296 |
--- /dev/null |
+++ b/chrome/browser/jumplist_metrics.cc |
@@ -0,0 +1,27 @@ |
+// Copyright 2014 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 "chrome/browser/jumplist_metrics.h" |
tapted
2014/11/10 23:47:41
Name this .cc file (and header) jumplist_metrics_w
noms (inactive)
2014/11/12 19:04:11
Done.
|
+ |
+#include "base/metrics/histogram.h" |
+ |
+// static |
tapted
2014/11/10 23:47:41
nit: usually this just goes before static member f
noms (inactive)
2014/11/12 19:04:11
Done.
|
+const char JumplistMetrics::kMostVisitedCategory[] = "most-visited"; |
+const char JumplistMetrics::kProfilesCategory[] = "profiles"; |
+const char JumplistMetrics::kRecentlyClosedCategory[] = "recently-closed"; |
+ |
+void JumplistMetrics::LogJumplistActionFromSwitchValue( |
+ const std::string& value) { |
+ JumplistCategory metric = CATEGORY_UNKNOWN; |
+ if (value == kMostVisitedCategory) |
+ metric = MOST_VISITED_URL; |
+ else if (value == kProfilesCategory) |
+ metric = SWITCH_TO_PROFILE; |
+ else if (value == kRecentlyClosedCategory) |
+ metric = RECENTLY_CLOSED_URL; |
+ DCHECK_NE(metric, CATEGORY_UNKNOWN); |
+ |
+ UMA_HISTOGRAM_ENUMERATION( |
+ "WinJumplist.Action", metric, NUM_JUMPLIST_CATEGORY_METRICS); |
+} |