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

Unified Diff: content/renderer/render_widget.cc

Issue 7621010: Never submit: tentative Pepper IME. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: snapshot. 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
« no previous file with comments | « content/renderer/render_widget.h ('k') | ppapi/api/dev/ppb_text_input_dev.idl » ('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 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() {
« no previous file with comments | « content/renderer/render_widget.h ('k') | ppapi/api/dev/ppb_text_input_dev.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698