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

Unified Diff: chrome/browser/chromeos/input_method/input_method_switch_recorder.cc

Issue 2925683002: Revert of chromeos: Remove some IME methods from ash::SystemTrayDelegate (Closed)
Patch Set: Created 3 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
« no previous file with comments | « chrome/browser/chromeos/input_method/input_method_switch_recorder.h ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/input_method/input_method_switch_recorder.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_switch_recorder.cc b/chrome/browser/chromeos/input_method/input_method_switch_recorder.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2b8fdf442a8ff458b3f5b8ba5c921136b5f0cff3
--- /dev/null
+++ b/chrome/browser/chromeos/input_method/input_method_switch_recorder.cc
@@ -0,0 +1,48 @@
+// Copyright (c) 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/chromeos/input_method/input_method_switch_recorder.h"
+
+#include "base/metrics/histogram_macros.h"
+
+namespace {
+
+chromeos::input_method::InputMethodSwitchRecorder*
+ g_input_method_switch_recorder = NULL;
+
+enum SwitchBy {
+ // The values should not reordered or deleted and new entries should only be
+ // added at the end (otherwise it will cause problems interpreting logs)
+ SWITCH_BY_TRAY = 0,
+ SWITCH_BY_ACCELERATOR = 1,
+ NUM_SWITCH_BY = 2
+};
+
+} // namespace
+
+namespace chromeos {
+namespace input_method {
+
+// static
+InputMethodSwitchRecorder* InputMethodSwitchRecorder::Get() {
+ if (!g_input_method_switch_recorder)
+ g_input_method_switch_recorder = new InputMethodSwitchRecorder();
+ return g_input_method_switch_recorder;
+}
+
+InputMethodSwitchRecorder::InputMethodSwitchRecorder() {
+}
+
+InputMethodSwitchRecorder::~InputMethodSwitchRecorder() {
+}
+
+void InputMethodSwitchRecorder::RecordSwitch(bool by_tray_menu) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "InputMethod.ImeSwitch",
+ by_tray_menu ? SWITCH_BY_TRAY : SWITCH_BY_ACCELERATOR, NUM_SWITCH_BY);
+}
+
+} // namespace input_method
+} // namespace chromeos
+
« no previous file with comments | « chrome/browser/chromeos/input_method/input_method_switch_recorder.h ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698