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

Unified Diff: content/renderer/render_widget.cc

Issue 7977017: Never submit: tentative Pepper IME. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months 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
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 7b2f48a79374a43eac861a774551293f251a451c..fd598611178f914388756146b962c01790a9393f 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -1286,12 +1286,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.
@@ -1322,15 +1323,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() {

Powered by Google App Engine
This is Rietveld 408576698