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

Unified Diff: content/renderer/render_widget.cc

Issue 2508363003: [refactor] - Move textInputInfo() and textInputType() from WebWidget to WebInputMethodController (Closed)
Patch Set: 'controller' may be nullptr. Created 4 years, 1 month 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 | « content/renderer/render_view_browsertest.cc ('k') | third_party/WebKit/Source/web/WebFrameWidgetImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index dc1f14d8a538aa4db7acaddb94aac06061415076..b2eaeff87597db5e71a535d4a6d389cc30ced5fc 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -1038,8 +1038,8 @@ void RenderWidget::UpdateTextInputState(ShowIme show_ime,
return; // Not considered as a text input field in WebKit/Chromium.
blink::WebTextInputInfo new_info;
- if (GetWebWidget())
- new_info = GetWebWidget()->textInputInfo();
+ if (auto* controller = GetInputMethodController())
+ new_info = controller->textInputInfo();
const ui::TextInputMode new_mode =
ConvertWebTextInputMode(new_info.inputMode);
@@ -1742,8 +1742,8 @@ ui::TextInputType RenderWidget::GetTextInputType() {
if (focused_pepper_plugin_)
return focused_pepper_plugin_->text_input_type();
#endif
- if (GetWebWidget())
- return ConvertWebTextInputType(GetWebWidget()->textInputType());
+ if (auto* controller = GetInputMethodController())
+ return ConvertWebTextInputType(controller->textInputType());
return ui::TEXT_INPUT_TYPE_NONE;
}
@@ -2172,7 +2172,8 @@ void RenderWidget::didHandleGestureEvent(
UpdateTextInputState(ShowIme::IF_NEEDED, ChangeSource::FROM_NON_IME);
} else if (event.type == WebInputEvent::GestureLongPress) {
DCHECK(GetWebWidget());
- if (GetWebWidget()->textInputInfo().value.isEmpty())
+ blink::WebInputMethodController* controller = GetInputMethodController();
+ if (controller && controller->textInputInfo().value.isEmpty())
Charlie Reis 2016/11/23 23:35:09 Is this right? This looks like it's hiding the IM
EhsanK 2016/11/24 02:27:45 Yes. Apparently, this is because we should show a
UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_NON_IME);
else
UpdateTextInputState(ShowIme::IF_NEEDED, ChangeSource::FROM_NON_IME);
« no previous file with comments | « content/renderer/render_view_browsertest.cc ('k') | third_party/WebKit/Source/web/WebFrameWidgetImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698