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(
if (!active_ || current_input_type_ == ui::TEXT_INPUT_TYPE_NONE)
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_;
++next_context_id_;
......@@ -555,17 +545,8 @@ void InputMethodEngine::FocusOut() {
if (!active_ || current_input_type_ == ui::TEXT_INPUT_TYPE_NONE)
return;
ui::TextInputType previous_input_type = current_input_type_;
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_;
context_id_ = -1;
observer_->OnBlur(context_id);
......
......@@ -248,16 +248,16 @@ TEST_F(InputMethodEngineTest, TestSwitching_Password_3rd_Party) {
FocusIn(ui::TEXT_INPUT_TYPE_PASSWORD);
EXPECT_EQ(NONE, observer_->GetCallsBitmapAndReset());
engine_->Enable();
EXPECT_EQ(ACTIVATE, observer_->GetCallsBitmapAndReset());
EXPECT_EQ(ACTIVATE | ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->Disable();
EXPECT_EQ(DEACTIVATED, observer_->GetCallsBitmapAndReset());
// Focus change when enabled.
engine_->Enable();
EXPECT_EQ(ACTIVATE, observer_->GetCallsBitmapAndReset());
EXPECT_EQ(ACTIVATE | ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->FocusOut();
EXPECT_EQ(NONE, observer_->GetCallsBitmapAndReset());
EXPECT_EQ(ONBLUR, observer_->GetCallsBitmapAndReset());
FocusIn(ui::TEXT_INPUT_TYPE_PASSWORD);
EXPECT_EQ(NONE, observer_->GetCallsBitmapAndReset());
EXPECT_EQ(ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->Disable();
EXPECT_EQ(DEACTIVATED, observer_->GetCallsBitmapAndReset());
}
......
......@@ -30,7 +30,7 @@
"description": "Describes an input Context",
"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."},
"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