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

Unified Diff: ash/common/system/chromeos/ime_menu/ime_menu_tray.cc

Issue 2600173002: Add metrics to track buttons clicked in IME menu tray. (Closed)
Patch Set: Created 4 years 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
diff --git a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
index 2fd3d3f74625a7ff65c66fd7f1dc518d52bc18c6..a6f2988e405bda531f8c7e4f4213dc2de5ee2767 100644
--- a/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
+++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray.cc
@@ -26,6 +26,7 @@
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/public/cpp/shell_window_ids.h"
+#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "grit/ash_resources.h"
#include "grit/ash_strings.h"
@@ -202,14 +203,18 @@ class ImeButtonsView : public views::View,
// extensions. InputMethodManager::ShowKeyboardWithKeyset() will deal with
// the |keyset| string to generate the right input view url.
std::string keyset;
- if (sender == emoji_button_)
+ if (sender == emoji_button_) {
keyset = "emoji";
- else if (sender == voice_button_)
+ UMA_HISTOGRAM_COUNTS("InputMethod.ImeMenu.EmojiButton", 1);
+ } else if (sender == voice_button_) {
keyset = "voice";
- else if (sender == handwriting_button_)
+ UMA_HISTOGRAM_COUNTS("InputMethod.ImeMenu.VoiceButton", 1);
+ } else if (sender == handwriting_button_) {
keyset = "hwt";
- else
+ UMA_HISTOGRAM_COUNTS("InputMethod.ImeMenu.HandwritingButton", 1);
Alexei Svitkine (slow) 2017/01/03 15:47:22 UMA_HISTOGRAM_COUNTS allocates 50 buckets but you'
Azure Wei 2017/01/04 14:02:41 Thanks. I've updated these with enum histogram and
+ } else {
NOTREACHED();
+ }
ime_menu_tray_->ShowKeyboardWithKeyset(keyset);
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698