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 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2063 } | 2063 } |
2064 | 2064 |
2065 void RenderFrameImpl::OnVisualStateRequest(uint64_t id) { | 2065 void RenderFrameImpl::OnVisualStateRequest(uint64_t id) { |
2066 GetRenderWidget()->QueueMessage( | 2066 GetRenderWidget()->QueueMessage( |
2067 new FrameHostMsg_VisualStateResponse(routing_id_, id), | 2067 new FrameHostMsg_VisualStateResponse(routing_id_, id), |
2068 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE); | 2068 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE); |
2069 } | 2069 } |
2070 | 2070 |
2071 void RenderFrameImpl::OnSetEditableSelectionOffsets(int start, int end) { | 2071 void RenderFrameImpl::OnSetEditableSelectionOffsets(int start, int end) { |
2072 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); | 2072 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); |
2073 if (!GetRenderWidget()->ShouldHandleImeEvent()) | |
2074 return; | |
2075 ImeEventGuard guard(GetRenderWidget()); | 2073 ImeEventGuard guard(GetRenderWidget()); |
2076 frame_->setEditableSelectionOffsets(start, end); | 2074 frame_->setEditableSelectionOffsets(start, end); |
2077 } | 2075 } |
2078 | 2076 |
2079 void RenderFrameImpl::OnSetCompositionFromExistingText( | 2077 void RenderFrameImpl::OnSetCompositionFromExistingText( |
2080 int start, int end, | 2078 int start, int end, |
2081 const std::vector<blink::WebCompositionUnderline>& underlines) { | 2079 const std::vector<blink::WebCompositionUnderline>& underlines) { |
2082 if (!GetRenderWidget()->ShouldHandleImeEvent()) | |
2083 return; | |
2084 ImeEventGuard guard(GetRenderWidget()); | 2080 ImeEventGuard guard(GetRenderWidget()); |
2085 frame_->setCompositionFromExistingText(start, end, underlines); | 2081 frame_->setCompositionFromExistingText(start, end, underlines); |
2086 } | 2082 } |
2087 | 2083 |
2088 void RenderFrameImpl::OnExecuteNoValueEditCommand(const std::string& name) { | 2084 void RenderFrameImpl::OnExecuteNoValueEditCommand(const std::string& name) { |
2089 frame_->executeCommand(WebString::fromUTF8(name)); | 2085 frame_->executeCommand(WebString::fromUTF8(name)); |
2090 } | 2086 } |
2091 | 2087 |
2092 void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) { | 2088 void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) { |
2093 if (!GetRenderWidget()->ShouldHandleImeEvent()) | |
2094 return; | |
2095 | |
2096 ImeEventGuard guard(GetRenderWidget()); | 2089 ImeEventGuard guard(GetRenderWidget()); |
2097 frame_->extendSelectionAndDelete(before, after); | 2090 frame_->extendSelectionAndDelete(before, after); |
2098 } | 2091 } |
2099 | 2092 |
2100 void RenderFrameImpl::OnDeleteSurroundingText(int before, int after) { | 2093 void RenderFrameImpl::OnDeleteSurroundingText(int before, int after) { |
2101 if (!GetRenderWidget()->ShouldHandleImeEvent()) | |
2102 return; | |
2103 | |
2104 ImeEventGuard guard(GetRenderWidget()); | 2094 ImeEventGuard guard(GetRenderWidget()); |
2105 frame_->deleteSurroundingText(before, after); | 2095 frame_->deleteSurroundingText(before, after); |
2106 } | 2096 } |
2107 | 2097 |
2108 void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { | 2098 void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { |
2109 if (accessibility_mode_ == new_mode) | 2099 if (accessibility_mode_ == new_mode) |
2110 return; | 2100 return; |
2111 accessibility_mode_ = new_mode; | 2101 accessibility_mode_ = new_mode; |
2112 if (render_accessibility_) { | 2102 if (render_accessibility_) { |
2113 // Note: this isn't called automatically by the destructor because | 2103 // Note: this isn't called automatically by the destructor because |
(...skipping 4557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6671 // event target. Potentially a Pepper plugin will receive the event. | 6661 // event target. Potentially a Pepper plugin will receive the event. |
6672 // In order to tell whether a plugin gets the last mouse event and which it | 6662 // In order to tell whether a plugin gets the last mouse event and which it |
6673 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6663 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6674 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6664 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6675 // |pepper_last_mouse_event_target_|. | 6665 // |pepper_last_mouse_event_target_|. |
6676 pepper_last_mouse_event_target_ = nullptr; | 6666 pepper_last_mouse_event_target_ = nullptr; |
6677 #endif | 6667 #endif |
6678 } | 6668 } |
6679 | 6669 |
6680 } // namespace content | 6670 } // namespace content |
OLD | NEW |