Commit 0105097d authored by shuchen@chromium.org's avatar shuchen@chromium.org

Removes the restriction of onFocus event on password field to 3rd party IMEs.

BUG=356569
TEST=None

Review URL: https://codereview.chromium.org/345653004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278701 0039d316-1c4b-4281-b951-d872f2087c98
parent ea0318b8
...@@ -509,16 +509,6 @@ void InputMethodEngine::FocusIn( ...@@ -509,16 +509,6 @@ void InputMethodEngine::FocusIn(
if (!active_ || current_input_type_ == ui::TEXT_INPUT_TYPE_NONE) if (!active_ || current_input_type_ == ui::TEXT_INPUT_TYPE_NONE)
return; return;
// Prevent sending events on password field to 3rd-party IME extensions.
// And also make sure the VK fallback to system VK.
// TODO(shuchen): for password field, forcibly switch/lock the IME to the XKB
// keyboard related to the current IME.
if (current_input_type_ == ui::TEXT_INPUT_TYPE_PASSWORD &&
!extension_ime_util::IsComponentExtensionIME(GetDescriptor().id())) {
EnableInputView(false);
return;
}
context_id_ = next_context_id_; context_id_ = next_context_id_;
++next_context_id_; ++next_context_id_;
...@@ -555,17 +545,8 @@ void InputMethodEngine::FocusOut() { ...@@ -555,17 +545,8 @@ void InputMethodEngine::FocusOut() {
if (!active_ || current_input_type_ == ui::TEXT_INPUT_TYPE_NONE) if (!active_ || current_input_type_ == ui::TEXT_INPUT_TYPE_NONE)
return; return;
ui::TextInputType previous_input_type = current_input_type_;
current_input_type_ = ui::TEXT_INPUT_TYPE_NONE; current_input_type_ = ui::TEXT_INPUT_TYPE_NONE;
// Prevent sending events on password field to 3rd-party IME extensions.
// And also make sure the VK restore to IME input view.
if (previous_input_type == ui::TEXT_INPUT_TYPE_PASSWORD &&
!extension_ime_util::IsComponentExtensionIME(GetDescriptor().id())) {
EnableInputView(true);
return;
}
int context_id = context_id_; int context_id = context_id_;
context_id_ = -1; context_id_ = -1;
observer_->OnBlur(context_id); observer_->OnBlur(context_id);
......
...@@ -248,16 +248,16 @@ TEST_F(InputMethodEngineTest, TestSwitching_Password_3rd_Party) { ...@@ -248,16 +248,16 @@ TEST_F(InputMethodEngineTest, TestSwitching_Password_3rd_Party) {
FocusIn(ui::TEXT_INPUT_TYPE_PASSWORD); FocusIn(ui::TEXT_INPUT_TYPE_PASSWORD);
EXPECT_EQ(NONE, observer_->GetCallsBitmapAndReset()); EXPECT_EQ(NONE, observer_->GetCallsBitmapAndReset());
engine_->Enable(); engine_->Enable();
EXPECT_EQ(ACTIVATE, observer_->GetCallsBitmapAndReset()); EXPECT_EQ(ACTIVATE | ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->Disable(); engine_->Disable();
EXPECT_EQ(DEACTIVATED, observer_->GetCallsBitmapAndReset()); EXPECT_EQ(DEACTIVATED, observer_->GetCallsBitmapAndReset());
// Focus change when enabled. // Focus change when enabled.
engine_->Enable(); engine_->Enable();
EXPECT_EQ(ACTIVATE, observer_->GetCallsBitmapAndReset()); EXPECT_EQ(ACTIVATE | ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->FocusOut(); engine_->FocusOut();
EXPECT_EQ(NONE, observer_->GetCallsBitmapAndReset()); EXPECT_EQ(ONBLUR, observer_->GetCallsBitmapAndReset());
FocusIn(ui::TEXT_INPUT_TYPE_PASSWORD); FocusIn(ui::TEXT_INPUT_TYPE_PASSWORD);
EXPECT_EQ(NONE, observer_->GetCallsBitmapAndReset()); EXPECT_EQ(ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->Disable(); engine_->Disable();
EXPECT_EQ(DEACTIVATED, observer_->GetCallsBitmapAndReset()); EXPECT_EQ(DEACTIVATED, observer_->GetCallsBitmapAndReset());
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"description": "Describes an input Context", "description": "Describes an input Context",
"properties": { "properties": {
"contextID": {"type": "integer", "description": "This is used to specify targets of text field operations. This ID becomes invalid as soon as onBlur is called."}, "contextID": {"type": "integer", "description": "This is used to specify targets of text field operations. This ID becomes invalid as soon as onBlur is called."},
"type": {"type": "string", "description": "Type of value this text field edits, (Text, Number, URL, etc)", "enum": ["text", "search", "tel", "url", "email", "number"]} "type": {"type": "string", "description": "Type of value this text field edits, (Text, Number, URL, etc)", "enum": ["text", "search", "tel", "url", "email", "number", "password"]}
} }
}, },
{ {
......
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