Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_android.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc |
| index d16141b25ff6c3ad5a005f1253f50968229dae01..dd0c9018f5712a282c73ccb7b7f5bcd5b38b27b7 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_android.cc |
| +++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
| @@ -26,7 +26,8 @@ RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid( |
| // ContentViewCore. It being NULL means that it is not attached to the |
| // View system yet, so we treat it as hidden. |
| is_hidden_(!content_view_core), |
| - content_view_core_(content_view_core) { |
| + content_view_core_(content_view_core), |
| + ime_adapter_android_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
| host_->SetView(this); |
| // RenderWidgetHost is initialized as visible. If is_hidden_ is true, tell |
| // RenderWidgetHost to hide. |
| @@ -178,10 +179,23 @@ void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) { |
| void RenderWidgetHostViewAndroid::TextInputStateChanged( |
| const ViewHostMsg_TextInputState_Params& params) { |
| - NOTIMPLEMENTED(); |
| + if (is_hidden_) |
| + return; |
| + |
| + content_view_core_->ImeUpdateAdapter( |
| + reinterpret_cast<int>(&ime_adapter_android_), |
|
bulach
2012/08/31 11:36:24
nit: could use GetNativeImeAdapter() here.
olilan
2012/08/31 16:47:10
Done.
|
| + static_cast<int>(params.type), |
| + params.value, params.selection_start, params.selection_end, |
| + params.composition_start, params.composition_end, |
| + false /* show_ime_if_needed */); |
| +} |
| + |
| +int RenderWidgetHostViewAndroid::GetNativeImeAdapter() { |
| + return reinterpret_cast<int>(&ime_adapter_android_); |
| } |
| void RenderWidgetHostViewAndroid::ImeCancelComposition() { |
| + ime_adapter_android_.CancelComposition(); |
| } |
| void RenderWidgetHostViewAndroid::DidUpdateBackingStore( |
| @@ -337,6 +351,14 @@ void RenderWidgetHostViewAndroid::UnlockMouse() { |
| NOTIMPLEMENTED(); |
| } |
| +// Methods called from the host to the render |
| + |
| +void RenderWidgetHostViewAndroid::SendKeyEvent( |
| + const NativeWebKeyboardEvent& event) { |
| + if (host_) |
| + host_->ForwardKeyboardEvent(event); |
| +} |
| + |
| void RenderWidgetHostViewAndroid::TouchEvent( |
| const WebKit::WebTouchEvent& event) { |
| if (host_) |