 Chromium Code Reviews
 Chromium Code Reviews Issue 7041003:
  Show composition text on IME panel when Pepper plugin is focused (Linux).  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 7041003:
  Show composition text on IME panel when Pepper plugin is focused (Linux).  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| Index: content/renderer/render_widget.cc | 
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc | 
| index f02b920abde7000de2a5ee51d835dd371f6a1d2f..c1bbe2522c2a3a9d072fd4edcdf2d24f0fc14e7c 100644 | 
| --- a/content/renderer/render_widget.cc | 
| +++ b/content/renderer/render_widget.cc | 
| @@ -58,7 +58,6 @@ using WebKit::WebRect; | 
| using WebKit::WebScreenInfo; | 
| using WebKit::WebSize; | 
| using WebKit::WebTextDirection; | 
| -using WebKit::WebTextInputType; | 
| using WebKit::WebVector; | 
| using WebKit::WebWidget; | 
| @@ -83,7 +82,8 @@ RenderWidget::RenderWidget(RenderThreadBase* render_thread, | 
| closing_(false), | 
| is_swapped_out_(false), | 
| input_method_is_active_(false), | 
| - text_input_type_(WebKit::WebTextInputTypeNone), | 
| + text_input_type_(ui::TEXT_INPUT_TYPE_NONE), | 
| + can_compose_inline_(true), | 
| popup_type_(popup_type), | 
| pending_window_rect_count_(0), | 
| suppress_next_char_events_(false), | 
| @@ -1278,7 +1278,8 @@ void RenderWidget::UpdateInputMethod() { | 
| if (!input_method_is_active_) | 
| return; | 
| - WebTextInputType new_type = GetTextInputType(); | 
| + ui::TextInputType new_type = GetTextInputType(); | 
| + bool new_can_compose_inline = CanComposeInline(); | 
| WebRect new_caret_bounds; | 
| if (webwidget_) | 
| @@ -1286,18 +1287,24 @@ void RenderWidget::UpdateInputMethod() { | 
| // Only sends text input type and caret bounds to the browser process if they | 
| // are changed. | 
| - if (text_input_type_ != new_type || caret_bounds_ != new_caret_bounds) { | 
| + if (text_input_type_ != new_type || caret_bounds_ != new_caret_bounds || | 
| + can_compose_inline_ != new_can_compose_inline) { | 
| text_input_type_ = new_type; | 
| + can_compose_inline_ = new_can_compose_inline; | 
| caret_bounds_ = new_caret_bounds; | 
| Send(new ViewHostMsg_ImeUpdateTextInputState( | 
| - routing_id(), new_type, new_caret_bounds)); | 
| + routing_id(), new_type, new_can_compose_inline, new_caret_bounds)); | 
| } | 
| } | 
| -WebKit::WebTextInputType RenderWidget::GetTextInputType() { | 
| +ui::TextInputType RenderWidget::GetTextInputType() { | 
| if (webwidget_) | 
| - return webwidget_->textInputType(); | 
| - return WebKit::WebTextInputTypeNone; | 
| + return static_cast<ui::TextInputType>(webwidget_->textInputType()); | 
| 
brettw
2011/06/13 14:52:36
I'm worried about these things getting out-of-sync
 
kinaba
2011/06/13 17:48:16
Added a DCHECK for that we receive a known (to the
 | 
| + return ui::TEXT_INPUT_TYPE_NONE; | 
| +} | 
| + | 
| +bool RenderWidget::CanComposeInline() { | 
| + return true; | 
| } | 
| WebScreenInfo RenderWidget::screenInfo() { | 
| @@ -1312,7 +1319,7 @@ void RenderWidget::resetInputMethod() { | 
| // If the last text input type is not None, then we should finish any | 
| // ongoing composition regardless of the new text input type. | 
| - if (text_input_type_ != WebKit::WebTextInputTypeNone) { | 
| + if (text_input_type_ != ui::TEXT_INPUT_TYPE_NONE) { | 
| // If a composition text exists, then we need to let the browser process | 
| // to cancel the input method's ongoing composition session. | 
| if (webwidget_->confirmComposition()) |