Commit f20cd935 authored by John Palmer's avatar John Palmer Committed by Commit Bot

Fix some bugs in how input mode is parsed.

1) Actually use the mode parsing function
2) Default to "" rather than "text" which brings the behaviour to be
more like what would be expected

Change-Id: I6a46437ac797d59810e099af1ddf564d532e05b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087497Reviewed-by: default avatarKeith Lee <keithlee@chromium.org>
Commit-Queue: John Palmer <jopalmer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748077}
parent 060a170c
...@@ -234,7 +234,7 @@ class ImeObserverChromeOS : public ui::ImeObserver { ...@@ -234,7 +234,7 @@ class ImeObserverChromeOS : public ui::ImeObserver {
input_context.type = input_method_private::ParseInputContextType( input_context.type = input_method_private::ParseInputContextType(
ConvertInputContextType(context)); ConvertInputContextType(context));
input_context.mode = input_method_private::ParseInputModeType( input_context.mode = input_method_private::ParseInputModeType(
ConvertInputContextType(context)); ConvertInputContextMode(context));
input_context.auto_correct = ConvertInputContextAutoCorrect(context); input_context.auto_correct = ConvertInputContextAutoCorrect(context);
input_context.auto_complete = ConvertInputContextAutoComplete(context); input_context.auto_complete = ConvertInputContextAutoComplete(context);
input_context.auto_capitalize = input_context.auto_capitalize =
...@@ -382,7 +382,7 @@ class ImeObserverChromeOS : public ui::ImeObserver { ...@@ -382,7 +382,7 @@ class ImeObserverChromeOS : public ui::ImeObserver {
std::string ConvertInputContextMode( std::string ConvertInputContextMode(
ui::IMEEngineHandlerInterface::InputContext input_context) { ui::IMEEngineHandlerInterface::InputContext input_context) {
std::string input_mode_type = "text"; std::string input_mode_type = "none"; // default to nothing
switch (input_context.mode) { switch (input_context.mode) {
case ui::TEXT_INPUT_MODE_SEARCH: case ui::TEXT_INPUT_MODE_SEARCH:
input_mode_type = "search"; input_mode_type = "search";
...@@ -405,9 +405,12 @@ class ImeObserverChromeOS : public ui::ImeObserver { ...@@ -405,9 +405,12 @@ class ImeObserverChromeOS : public ui::ImeObserver {
case ui::TEXT_INPUT_MODE_NONE: case ui::TEXT_INPUT_MODE_NONE:
input_mode_type = "noKeyboard"; input_mode_type = "noKeyboard";
break; break;
default: case ui::TEXT_INPUT_MODE_TEXT:
input_mode_type = "text"; input_mode_type = "text";
break; break;
default:
input_mode_type = "";
break;
} }
return input_mode_type; return input_mode_type;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment