Chromium Code Reviews| 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 { | 3985 } else { |
| 3986 return RenderWidget::GetTextInputType(); | 3986 return RenderWidget::GetTextInputType(); |
| 3987 } | 3987 } |
| 3988 } | 3988 } |
| 3989 | 3989 |
| 3990 bool RenderView::CanComposeInline() { | |
| 3991 if (pepper_delegate_.IsPluginFocused()) { | |
| 3992 // TODO(kinaba) Until PPAPI has an interface for handling IME events, we | |
| 3993 // consider all the parts of PPAPI plugins are accepting text inputs. | |
| 3994 return false; | |
| 3995 } else { | |
|
brettw
2011/06/13 14:52:36
Normally we prefer no "else" after a return statem
kinaba
2011/06/13 17:48:16
Done.
| |
| 3996 return true; | |
| 3997 } | |
| 3998 } | |
| 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() { |
| 3998 IPC::Message* msg = new ViewHostMsg_StartPluginIme(routing_id()); | 4008 IPC::Message* msg = new ViewHostMsg_StartPluginIme(routing_id()); |
| 3999 // This message can be sent during event-handling, and needs to be delivered | 4009 // This message can be sent during event-handling, and needs to be delivered |
| (...skipping 242 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 |