| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/render_view.h" | 5 #include "content/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 3959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3970 char_event.text[0] = text[i]; | 3970 char_event.text[0] = text[i]; |
| 3971 char_event.unmodifiedText[0] = text[i]; | 3971 char_event.unmodifiedText[0] = text[i]; |
| 3972 if (webwidget_) | 3972 if (webwidget_) |
| 3973 webwidget_->handleInputEvent(char_event); | 3973 webwidget_->handleInputEvent(char_event); |
| 3974 } | 3974 } |
| 3975 } else { | 3975 } else { |
| 3976 RenderWidget::OnImeConfirmComposition(text); | 3976 RenderWidget::OnImeConfirmComposition(text); |
| 3977 } | 3977 } |
| 3978 } | 3978 } |
| 3979 | 3979 |
| 3980 WebKit::WebTextInputType RenderView::GetTextInputType() { | 3980 ui::TextInputType RenderView::GetTextInputType() { |
| 3981 if (pepper_delegate_.IsPluginFocused()) { | 3981 if (pepper_delegate_.IsPluginFocused()) { |
| 3982 // TODO(kinaba) Until PPAPI has an interface for handling IME events, we | 3982 // TODO(kinaba) Until PPAPI has an interface for handling IME events, we |
| 3983 // consider all the parts of PPAPI plugins are accepting text inputs. | 3983 // consider all the parts of PPAPI plugins are accepting text inputs. |
| 3984 return WebKit::WebTextInputTypeText; | 3984 return ui::TEXT_INPUT_TYPE_TEXT; |
| 3985 } else { | |
| 3986 return RenderWidget::GetTextInputType(); | |
| 3987 } | 3985 } |
| 3986 return RenderWidget::GetTextInputType(); |
| 3987 } |
| 3988 |
| 3989 bool RenderView::CanComposeInline() { |
| 3990 if (pepper_delegate_.IsPluginFocused()) { |
| 3991 // TODO(kinaba) Until PPAPI has an interface for handling IME events, there |
| 3992 // is no way for the browser to know whether the plugin is capable of |
| 3993 // drawing composition text. We assume plugins are incapable and let the |
| 3994 // browser handle composition display for now. |
| 3995 return false; |
| 3996 } |
| 3997 return true; |
| 3988 } | 3998 } |
| 3989 | 3999 |
| 3990 #if defined(OS_MACOSX) | 4000 #if defined(OS_MACOSX) |
| 3991 void RenderView::PluginFocusChanged(bool focused, int plugin_id) { | 4001 void RenderView::PluginFocusChanged(bool focused, int plugin_id) { |
| 3992 IPC::Message* msg = new ViewHostMsg_PluginFocusChanged(routing_id(), | 4002 IPC::Message* msg = new ViewHostMsg_PluginFocusChanged(routing_id(), |
| 3993 focused, plugin_id); | 4003 focused, plugin_id); |
| 3994 Send(msg); | 4004 Send(msg); |
| 3995 } | 4005 } |
| 3996 | 4006 |
| 3997 void RenderView::StartPluginIme() { | 4007 void RenderView::StartPluginIme() { |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4242 const webkit_glue::CustomContextMenuContext& custom_context) { | 4252 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 4243 if (custom_context.is_pepper_menu) | 4253 if (custom_context.is_pepper_menu) |
| 4244 pepper_delegate_.OnContextMenuClosed(custom_context); | 4254 pepper_delegate_.OnContextMenuClosed(custom_context); |
| 4245 else | 4255 else |
| 4246 context_menu_node_.reset(); | 4256 context_menu_node_.reset(); |
| 4247 } | 4257 } |
| 4248 | 4258 |
| 4249 void RenderView::OnNetworkStateChanged(bool online) { | 4259 void RenderView::OnNetworkStateChanged(bool online) { |
| 4250 WebNetworkStateNotifier::setOnLine(online); | 4260 WebNetworkStateNotifier::setOnLine(online); |
| 4251 } | 4261 } |
| OLD | NEW |