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

Unified Diff: content/renderer/render_widget.cc

Issue 2508363003: [refactor] - Move textInputInfo() and textInputType() from WebWidget to WebInputMethodController (Closed)
Patch Set: Fixed Rebase Created 4 years 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_impl.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 f25fa82c1ad78cffa9a3fd4caeadb67117cd1a80..d67bdfefac27d770dddd63fc56b0255b902adbe3 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -1033,8 +1033,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);
@@ -1728,8 +1728,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;
}
@@ -2110,7 +2110,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())
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_impl.cc ('k') | third_party/WebKit/Source/web/WebFrameWidgetImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698