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

Unified Diff: blimp/common/logging.cc

Issue 2018243002: Add logger for ImeFeature messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@addFakeImeDelegate
Patch Set: Remove blank line Created 4 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 | « no previous file | blimp/common/logging_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/common/logging.cc
diff --git a/blimp/common/logging.cc b/blimp/common/logging.cc
index 174c2b4554a1111de459d0fd429f0a662d1d9f7d..0de9321a04d64f7938c6f2dbf8f03f194d86f533 100644
--- a/blimp/common/logging.cc
+++ b/blimp/common/logging.cc
@@ -77,6 +77,30 @@ class CompositorLogExtractor : public LogExtractor {
}
};
+// Logs fields from IME messages.
+class ImeLogExtractor : public LogExtractor {
+ void ExtractFields(const BlimpMessage& message,
+ LogFields* output) const override {
+ AddField("render_widget_id", message.ime().render_widget_id(), output);
+ switch (message.ime().type()) {
+ case ImeMessage::SHOW_IME:
+ AddField("subtype", "SHOW_IME", output);
+ AddField("text_input_type", message.ime().text_input_type(), output);
+ break;
+ case ImeMessage::HIDE_IME:
+ AddField("subtype", "HIDE_IME", output);
+ break;
+ case ImeMessage::SET_TEXT:
+ AddField("subtype", "SET_TEXT", output);
+ AddField("ime_text(length)", message.ime().ime_text().size(), output);
+ break;
+ case ImeMessage::UNKNOWN:
+ AddField("subtype", "UNKNOWN", output);
+ break;
+ }
+ }
+};
+
// Logs fields from INPUT messages.
class InputLogExtractor : public LogExtractor {
void ExtractFields(const BlimpMessage& message,
@@ -283,6 +307,7 @@ class NullLogExtractor : public LogExtractor {
BlimpMessageLogger::BlimpMessageLogger() {
AddHandler("COMPOSITOR", BlimpMessage::kCompositor,
base::WrapUnique(new CompositorLogExtractor));
+ AddHandler("IME", BlimpMessage::kIme, base::WrapUnique(new ImeLogExtractor));
AddHandler("INPUT", BlimpMessage::kInput,
base::WrapUnique(new InputLogExtractor));
AddHandler("NAVIGATION", BlimpMessage::kNavigation,
« no previous file with comments | « no previous file | blimp/common/logging_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698