| Index: content/renderer/render_view.cc
|
| diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
|
| index de09b3e397b07a85f4b917527705e8d4546ec424..272f5b005f20ca0d0377779f494ce232bbe1a2df 100644
|
| --- a/content/renderer/render_view.cc
|
| +++ b/content/renderer/render_view.cc
|
| @@ -4244,13 +4244,12 @@ void RenderView::OnImeSetComposition(
|
| const std::vector<WebKit::WebCompositionUnderline>& underlines,
|
| int selection_start,
|
| int selection_end) {
|
| - // Until PPAPI has an interface for handling IME events, we skip sending
|
| - // OnImeSetComposition. Otherwise the composition is canceled when a
|
| - // non-editable DOM element is focused.
|
| - //
|
| - // TODO(kinaba) This temporal remedy can be removed after PPAPI is extended
|
| - // with an IME handling interface.
|
| - if (!pepper_delegate_.IsPluginFocused()) {
|
| + if (pepper_delegate_.IsPluginFocused()) {
|
| + pepper_delegate_.OnImeSetComposition(text,
|
| + underlines,
|
| + selection_start,
|
| + selection_end);
|
| + } else {
|
| RenderWidget::OnImeSetComposition(text,
|
| underlines,
|
| selection_start,
|
| @@ -4260,48 +4259,35 @@ void RenderView::OnImeSetComposition(
|
|
|
| void RenderView::OnImeConfirmComposition(const string16& text) {
|
| if (pepper_delegate_.IsPluginFocused()) {
|
| - // TODO(kinaba) Until PPAPI has an interface for handling IME events, we
|
| - // send character events.
|
| - for (size_t i = 0; i < text.size(); ++i) {
|
| - WebKit::WebKeyboardEvent char_event;
|
| - char_event.type = WebKit::WebInputEvent::Char;
|
| - char_event.timeStampSeconds = base::Time::Now().ToDoubleT();
|
| - char_event.modifiers = 0;
|
| - char_event.windowsKeyCode = text[i];
|
| - char_event.nativeKeyCode = text[i];
|
| - char_event.text[0] = text[i];
|
| - char_event.unmodifiedText[0] = text[i];
|
| - if (webwidget_)
|
| - webwidget_->handleInputEvent(char_event);
|
| - }
|
| + pepper_delegate_.OnImeConfirmComposition(text);
|
| } else {
|
| RenderWidget::OnImeConfirmComposition(text);
|
| }
|
| }
|
|
|
| -ui::TextInputType RenderView::GetTextInputType() {
|
| +WebKit::WebTextInputType RenderView::GetTextInputType() {
|
| if (pepper_delegate_.IsPluginFocused()) {
|
| #if !defined(TOUCH_UI)
|
| - // TODO(kinaba) Until PPAPI has an interface for handling IME events, we
|
| - // consider all the parts of PPAPI plugins are accepting text inputs.
|
| - return ui::TEXT_INPUT_TYPE_TEXT;
|
| + return pepper_delegate_.GetTextInputType();
|
| #else
|
| // Disable keyboard input in flash for touch ui until PPAPI can support IME
|
| // events.
|
| - return ui::TEXT_INPUT_TYPE_NONE;
|
| + // TODO(kinaba): remove after IME-aware PPAPI flash is ready.
|
| + return WebKit::WebTextInputTypeNone;
|
| #endif
|
| }
|
| return RenderWidget::GetTextInputType();
|
| }
|
|
|
| +WebKit::WebRect RenderView::GetCaretBounds() {
|
| + if (pepper_delegate_.IsPluginFocused())
|
| + return pepper_delegate_.GetCaretBounds();
|
| + return RenderWidget::GetCaretBounds();
|
| +}
|
| +
|
| bool RenderView::CanComposeInline() {
|
| - if (pepper_delegate_.IsPluginFocused()) {
|
| - // TODO(kinaba) Until PPAPI has an interface for handling IME events, there
|
| - // is no way for the browser to know whether the plugin is capable of
|
| - // drawing composition text. We assume plugins are incapable and let the
|
| - // browser handle composition display for now.
|
| - return false;
|
| - }
|
| + if (pepper_delegate_.IsPluginFocused())
|
| + return pepper_delegate_.CanComposeInline();
|
| return true;
|
| }
|
|
|
|
|