| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1298 void RenderFrameImpl::PepperDidReceiveMouseEvent( | 1298 void RenderFrameImpl::PepperDidReceiveMouseEvent( |
| 1299 PepperPluginInstanceImpl* instance) { | 1299 PepperPluginInstanceImpl* instance) { |
| 1300 set_pepper_last_mouse_event_target(instance); | 1300 set_pepper_last_mouse_event_target(instance); |
| 1301 } | 1301 } |
| 1302 | 1302 |
| 1303 void RenderFrameImpl::PepperTextInputTypeChanged( | 1303 void RenderFrameImpl::PepperTextInputTypeChanged( |
| 1304 PepperPluginInstanceImpl* instance) { | 1304 PepperPluginInstanceImpl* instance) { |
| 1305 if (instance != focused_pepper_plugin_) | 1305 if (instance != focused_pepper_plugin_) |
| 1306 return; | 1306 return; |
| 1307 | 1307 |
| 1308 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, | 1308 GetRenderWidget()->UpdateTextInputState(ShowIme::DO_NOT_SHOW); |
| 1309 ChangeSource::FROM_NON_IME); | |
| 1310 | 1309 |
| 1311 FocusedNodeChangedForAccessibility(WebNode()); | 1310 FocusedNodeChangedForAccessibility(WebNode()); |
| 1312 } | 1311 } |
| 1313 | 1312 |
| 1314 void RenderFrameImpl::PepperCaretPositionChanged( | 1313 void RenderFrameImpl::PepperCaretPositionChanged( |
| 1315 PepperPluginInstanceImpl* instance) { | 1314 PepperPluginInstanceImpl* instance) { |
| 1316 if (instance != focused_pepper_plugin_) | 1315 if (instance != focused_pepper_plugin_) |
| 1317 return; | 1316 return; |
| 1318 GetRenderWidget()->UpdateSelectionBounds(); | 1317 GetRenderWidget()->UpdateSelectionBounds(); |
| 1319 } | 1318 } |
| (...skipping 2675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3995 return; | 3994 return; |
| 3996 | 3995 |
| 3997 if (is_empty_selection) | 3996 if (is_empty_selection) |
| 3998 selection_text_.clear(); | 3997 selection_text_.clear(); |
| 3999 | 3998 |
| 4000 // UpdateTextInputState should be called before SyncSelectionIfRequired. | 3999 // UpdateTextInputState should be called before SyncSelectionIfRequired. |
| 4001 // UpdateTextInputState may send TextInputStateChanged to notify the focus | 4000 // UpdateTextInputState may send TextInputStateChanged to notify the focus |
| 4002 // was changed, and SyncSelectionIfRequired may send SelectionChanged | 4001 // was changed, and SyncSelectionIfRequired may send SelectionChanged |
| 4003 // to notify the selection was changed. Focus change should be notified | 4002 // to notify the selection was changed. Focus change should be notified |
| 4004 // before selection change. | 4003 // before selection change. |
| 4005 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, | 4004 GetRenderWidget()->UpdateTextInputState(ShowIme::DO_NOT_SHOW); |
| 4006 ChangeSource::FROM_NON_IME); | |
| 4007 SyncSelectionIfRequired(); | 4005 SyncSelectionIfRequired(); |
| 4008 } | 4006 } |
| 4009 | 4007 |
| 4010 bool RenderFrameImpl::handleCurrentKeyboardEvent() { | 4008 bool RenderFrameImpl::handleCurrentKeyboardEvent() { |
| 4011 bool did_execute_command = false; | 4009 bool did_execute_command = false; |
| 4012 for (auto command : GetRenderWidget()->edit_commands()) { | 4010 for (auto command : GetRenderWidget()->edit_commands()) { |
| 4013 // In gtk and cocoa, it's possible to bind multiple edit commands to one | 4011 // In gtk and cocoa, it's possible to bind multiple edit commands to one |
| 4014 // key (but it's the exception). Once one edit command is not executed, it | 4012 // key (but it's the exception). Once one edit command is not executed, it |
| 4015 // seems safest to not execute the rest. | 4013 // seems safest to not execute the rest. |
| 4016 if (!frame_->executeCommand(blink::WebString::fromUTF8(command.name), | 4014 if (!frame_->executeCommand(blink::WebString::fromUTF8(command.name), |
| (...skipping 2689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6706 | 6704 |
| 6707 void RenderFrameImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance, | 6705 void RenderFrameImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance, |
| 6708 bool focused) { | 6706 bool focused) { |
| 6709 if (focused) | 6707 if (focused) |
| 6710 focused_pepper_plugin_ = instance; | 6708 focused_pepper_plugin_ = instance; |
| 6711 else if (focused_pepper_plugin_ == instance) | 6709 else if (focused_pepper_plugin_ == instance) |
| 6712 focused_pepper_plugin_ = nullptr; | 6710 focused_pepper_plugin_ = nullptr; |
| 6713 | 6711 |
| 6714 GetRenderWidget()->set_focused_pepper_plugin(focused_pepper_plugin_); | 6712 GetRenderWidget()->set_focused_pepper_plugin(focused_pepper_plugin_); |
| 6715 | 6713 |
| 6716 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, | 6714 GetRenderWidget()->UpdateTextInputState(ShowIme::DO_NOT_SHOW); |
| 6717 ChangeSource::FROM_NON_IME); | |
| 6718 GetRenderWidget()->UpdateSelectionBounds(); | 6715 GetRenderWidget()->UpdateSelectionBounds(); |
| 6719 } | 6716 } |
| 6720 | 6717 |
| 6721 void RenderFrameImpl::PepperStartsPlayback(PepperPluginInstanceImpl* instance) { | 6718 void RenderFrameImpl::PepperStartsPlayback(PepperPluginInstanceImpl* instance) { |
| 6722 RenderFrameImpl* const render_frame = instance->render_frame(); | 6719 RenderFrameImpl* const render_frame = instance->render_frame(); |
| 6723 if (render_frame) { | 6720 if (render_frame) { |
| 6724 render_frame->Send( | 6721 render_frame->Send( |
| 6725 new FrameHostMsg_PepperStartsPlayback( | 6722 new FrameHostMsg_PepperStartsPlayback( |
| 6726 render_frame->GetRoutingID(), | 6723 render_frame->GetRoutingID(), |
| 6727 instance->pp_instance())); | 6724 instance->pp_instance())); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6761 // event target. Potentially a Pepper plugin will receive the event. | 6758 // event target. Potentially a Pepper plugin will receive the event. |
| 6762 // In order to tell whether a plugin gets the last mouse event and which it | 6759 // In order to tell whether a plugin gets the last mouse event and which it |
| 6763 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6760 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6764 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6761 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6765 // |pepper_last_mouse_event_target_|. | 6762 // |pepper_last_mouse_event_target_|. |
| 6766 pepper_last_mouse_event_target_ = nullptr; | 6763 pepper_last_mouse_event_target_ = nullptr; |
| 6767 #endif | 6764 #endif |
| 6768 } | 6765 } |
| 6769 | 6766 |
| 6770 } // namespace content | 6767 } // namespace content |
| OLD | NEW |