Index: ui/views/controls/textfield/native_textfield_views.cc |
diff --git a/ui/views/controls/textfield/native_textfield_views.cc b/ui/views/controls/textfield/native_textfield_views.cc |
index 5e42d9dc9c87412f4e4ee0ef20a43acacfcaf0e9..cd46c5681f863b172c6d07a80ef06d556f1a326a 100644 |
--- a/ui/views/controls/textfield/native_textfield_views.cc |
+++ b/ui/views/controls/textfield/native_textfield_views.cc |
@@ -166,6 +166,7 @@ void NativeTextfieldViews::OnGestureEvent(ui::GestureEvent* event) { |
case ui::ET_GESTURE_TAP_DOWN: |
OnBeforeUserAction(); |
textfield_->RequestFocus(); |
+ ShowImeIfNeeded(); |
// We don't deselect if the point is in the selection |
// because TAP_DOWN may turn into a LONG_PRESS. |
if (!GetRenderText()->IsPointInSelection(event->location()) && |
@@ -610,6 +611,10 @@ void NativeTextfieldViews::UpdateVerticalMargins() { |
OnBoundsChanged(GetBounds()); |
} |
+void NativeTextfieldViews::ShowImeIfNeeded() const { |
+ GetInputMethod()->ShowImeIfNeeded(); |
+} |
+ |
bool NativeTextfieldViews::IsIMEComposing() const { |
return model_->HasCompositionText(); |
} |
@@ -1444,8 +1449,10 @@ void NativeTextfieldViews::TrackMouseClicks(const ui::MouseEvent& event) { |
} |
void NativeTextfieldViews::HandleMousePressEvent(const ui::MouseEvent& event) { |
- if (event.IsOnlyLeftMouseButton() || event.IsOnlyRightMouseButton()) |
+ if (event.IsOnlyLeftMouseButton() || event.IsOnlyRightMouseButton()) { |
textfield_->RequestFocus(); |
+ ShowImeIfNeeded(); |
+ } |
if (!event.IsOnlyLeftMouseButton()) |
return; |