| Index: content/renderer/render_widget.cc
|
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
| index 0541afe311f539e07552d9055e37bbf46ad7af5e..c876ed582e200b5845db3f31763a69f740869ee6 100644
|
| --- a/content/renderer/render_widget.cc
|
| +++ b/content/renderer/render_widget.cc
|
| @@ -1284,12 +1284,13 @@ void RenderWidget::UpdateInputMethod() {
|
| if (!input_method_is_active_)
|
| return;
|
|
|
| - ui::TextInputType new_type = GetTextInputType();
|
| + int type = GetTextInputType();
|
| + // Check the type is in the range representable by ui::TextInputType.
|
| + DCHECK(type <= ui::TEXT_INPUT_TYPE_URL) <<
|
| + "WebKit::WebTextInputType and ui::TextInputType not synchronized";
|
| + ui::TextInputType new_type = static_cast<ui::TextInputType>(type);
|
| bool new_can_compose_inline = CanComposeInline();
|
| - WebRect new_caret_bounds;
|
| -
|
| - if (webwidget_)
|
| - new_caret_bounds = webwidget_->caretOrSelectionBounds();
|
| + WebRect new_caret_bounds = GetCaretBounds();
|
|
|
| // Only sends text input type and caret bounds to the browser process if they
|
| // are changed.
|
| @@ -1320,15 +1321,16 @@ COMPILE_ASSERT(int(WebKit::WebTextInputTypeTelephone) == \
|
| COMPILE_ASSERT(int(WebKit::WebTextInputTypeURL) == \
|
| int(ui::TEXT_INPUT_TYPE_URL), mismatching_enums);
|
|
|
| -ui::TextInputType RenderWidget::GetTextInputType() {
|
| - if (webwidget_) {
|
| - int type = webwidget_->textInputType();
|
| - // Check the type is in the range representable by ui::TextInputType.
|
| - DCHECK(type <= ui::TEXT_INPUT_TYPE_URL) <<
|
| - "WebKit::WebTextInputType and ui::TextInputType not synchronized";
|
| - return static_cast<ui::TextInputType>(type);
|
| - }
|
| - return ui::TEXT_INPUT_TYPE_NONE;
|
| +WebRect RenderWidget::GetCaretBounds() {
|
| + if (!webwidget_)
|
| + return WebRect();
|
| + return webwidget_->caretOrSelectionBounds();
|
| +}
|
| +
|
| +WebKit::WebTextInputType RenderWidget::GetTextInputType() {
|
| + if (!webwidget_)
|
| + return WebKit::WebTextInputTypeNone;
|
| + return webwidget_->textInputType();
|
| }
|
|
|
| bool RenderWidget::CanComposeInline() {
|
|
|