| 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(); |
| 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 2716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4036 return; | 4035 return; |
| 4037 | 4036 |
| 4038 if (is_empty_selection) | 4037 if (is_empty_selection) |
| 4039 selection_text_.clear(); | 4038 selection_text_.clear(); |
| 4040 | 4039 |
| 4041 // UpdateTextInputState should be called before SyncSelectionIfRequired. | 4040 // UpdateTextInputState should be called before SyncSelectionIfRequired. |
| 4042 // UpdateTextInputState may send TextInputStateChanged to notify the focus | 4041 // UpdateTextInputState may send TextInputStateChanged to notify the focus |
| 4043 // was changed, and SyncSelectionIfRequired may send SelectionChanged | 4042 // was changed, and SyncSelectionIfRequired may send SelectionChanged |
| 4044 // to notify the selection was changed. Focus change should be notified | 4043 // to notify the selection was changed. Focus change should be notified |
| 4045 // before selection change. | 4044 // before selection change. |
| 4046 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, | 4045 GetRenderWidget()->UpdateTextInputState(); |
| 4047 ChangeSource::FROM_NON_IME); | |
| 4048 SyncSelectionIfRequired(); | 4046 SyncSelectionIfRequired(); |
| 4049 } | 4047 } |
| 4050 | 4048 |
| 4051 bool RenderFrameImpl::handleCurrentKeyboardEvent() { | 4049 bool RenderFrameImpl::handleCurrentKeyboardEvent() { |
| 4052 bool did_execute_command = false; | 4050 bool did_execute_command = false; |
| 4053 for (auto command : GetRenderWidget()->edit_commands()) { | 4051 for (auto command : GetRenderWidget()->edit_commands()) { |
| 4054 // In gtk and cocoa, it's possible to bind multiple edit commands to one | 4052 // In gtk and cocoa, it's possible to bind multiple edit commands to one |
| 4055 // key (but it's the exception). Once one edit command is not executed, it | 4053 // key (but it's the exception). Once one edit command is not executed, it |
| 4056 // seems safest to not execute the rest. | 4054 // seems safest to not execute the rest. |
| 4057 if (!frame_->executeCommand(blink::WebString::fromUTF8(command.name), | 4055 if (!frame_->executeCommand(blink::WebString::fromUTF8(command.name), |
| (...skipping 2746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6804 | 6802 |
| 6805 void RenderFrameImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance, | 6803 void RenderFrameImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance, |
| 6806 bool focused) { | 6804 bool focused) { |
| 6807 if (focused) | 6805 if (focused) |
| 6808 focused_pepper_plugin_ = instance; | 6806 focused_pepper_plugin_ = instance; |
| 6809 else if (focused_pepper_plugin_ == instance) | 6807 else if (focused_pepper_plugin_ == instance) |
| 6810 focused_pepper_plugin_ = nullptr; | 6808 focused_pepper_plugin_ = nullptr; |
| 6811 | 6809 |
| 6812 GetRenderWidget()->set_focused_pepper_plugin(focused_pepper_plugin_); | 6810 GetRenderWidget()->set_focused_pepper_plugin(focused_pepper_plugin_); |
| 6813 | 6811 |
| 6814 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, | 6812 GetRenderWidget()->UpdateTextInputState(); |
| 6815 ChangeSource::FROM_NON_IME); | |
| 6816 GetRenderWidget()->UpdateSelectionBounds(); | 6813 GetRenderWidget()->UpdateSelectionBounds(); |
| 6817 } | 6814 } |
| 6818 | 6815 |
| 6819 void RenderFrameImpl::PepperStartsPlayback(PepperPluginInstanceImpl* instance) { | 6816 void RenderFrameImpl::PepperStartsPlayback(PepperPluginInstanceImpl* instance) { |
| 6820 RenderFrameImpl* const render_frame = instance->render_frame(); | 6817 RenderFrameImpl* const render_frame = instance->render_frame(); |
| 6821 if (render_frame) { | 6818 if (render_frame) { |
| 6822 render_frame->Send( | 6819 render_frame->Send( |
| 6823 new FrameHostMsg_PepperStartsPlayback( | 6820 new FrameHostMsg_PepperStartsPlayback( |
| 6824 render_frame->GetRoutingID(), | 6821 render_frame->GetRoutingID(), |
| 6825 instance->pp_instance())); | 6822 instance->pp_instance())); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6877 // event target. Potentially a Pepper plugin will receive the event. | 6874 // event target. Potentially a Pepper plugin will receive the event. |
| 6878 // In order to tell whether a plugin gets the last mouse event and which it | 6875 // In order to tell whether a plugin gets the last mouse event and which it |
| 6879 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6876 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6880 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6877 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6881 // |pepper_last_mouse_event_target_|. | 6878 // |pepper_last_mouse_event_target_|. |
| 6882 pepper_last_mouse_event_target_ = nullptr; | 6879 pepper_last_mouse_event_target_ = nullptr; |
| 6883 #endif | 6880 #endif |
| 6884 } | 6881 } |
| 6885 | 6882 |
| 6886 } // namespace content | 6883 } // namespace content |
| OLD | NEW |