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 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1539 OnAdjustSelectionByCharacterOffset) | 1539 OnAdjustSelectionByCharacterOffset) |
1540 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect) | 1540 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect) |
1541 IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent, | 1541 IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent, |
1542 OnMoveRangeSelectionExtent) | 1542 OnMoveRangeSelectionExtent) |
1543 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace) | 1543 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace) |
1544 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling) | 1544 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling) |
1545 IPC_MESSAGE_HANDLER(FrameMsg_CopyImageAt, OnCopyImageAt) | 1545 IPC_MESSAGE_HANDLER(FrameMsg_CopyImageAt, OnCopyImageAt) |
1546 IPC_MESSAGE_HANDLER(FrameMsg_SaveImageAt, OnSaveImageAt) | 1546 IPC_MESSAGE_HANDLER(FrameMsg_SaveImageAt, OnSaveImageAt) |
1547 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete, | 1547 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete, |
1548 OnExtendSelectionAndDelete) | 1548 OnExtendSelectionAndDelete) |
| 1549 IPC_MESSAGE_HANDLER(InputMsg_DeleteSurroundingText, OnDeleteSurroundingText) |
1549 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText, | 1550 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText, |
1550 OnSetCompositionFromExistingText) | 1551 OnSetCompositionFromExistingText) |
1551 IPC_MESSAGE_HANDLER(InputMsg_SetEditableSelectionOffsets, | 1552 IPC_MESSAGE_HANDLER(InputMsg_SetEditableSelectionOffsets, |
1552 OnSetEditableSelectionOffsets) | 1553 OnSetEditableSelectionOffsets) |
1553 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand, | 1554 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand, |
1554 OnExecuteNoValueEditCommand) | 1555 OnExecuteNoValueEditCommand) |
1555 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole) | 1556 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole) |
1556 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest, | 1557 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest, |
1557 OnJavaScriptExecuteRequest) | 1558 OnJavaScriptExecuteRequest) |
1558 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests, | 1559 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests, |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2105 } | 2106 } |
2106 | 2107 |
2107 void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) { | 2108 void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) { |
2108 if (!GetRenderWidget()->ShouldHandleImeEvent()) | 2109 if (!GetRenderWidget()->ShouldHandleImeEvent()) |
2109 return; | 2110 return; |
2110 | 2111 |
2111 ImeEventGuard guard(GetRenderWidget()); | 2112 ImeEventGuard guard(GetRenderWidget()); |
2112 frame_->extendSelectionAndDelete(before, after); | 2113 frame_->extendSelectionAndDelete(before, after); |
2113 } | 2114 } |
2114 | 2115 |
| 2116 void RenderFrameImpl::OnDeleteSurroundingText(size_t before, size_t after) { |
| 2117 if (!GetRenderWidget()->ShouldHandleImeEvent()) |
| 2118 return; |
| 2119 |
| 2120 ImeEventGuard guard(GetRenderWidget()); |
| 2121 frame_->deleteSurroundingText(before, after); |
| 2122 } |
| 2123 |
2115 void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { | 2124 void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { |
2116 if (accessibility_mode_ == new_mode) | 2125 if (accessibility_mode_ == new_mode) |
2117 return; | 2126 return; |
2118 accessibility_mode_ = new_mode; | 2127 accessibility_mode_ = new_mode; |
2119 if (render_accessibility_) { | 2128 if (render_accessibility_) { |
2120 // Note: this isn't called automatically by the destructor because | 2129 // Note: this isn't called automatically by the destructor because |
2121 // there'd be no point in calling it in frame teardown, only if there's | 2130 // there'd be no point in calling it in frame teardown, only if there's |
2122 // an accessibility mode change but the frame is persisting. | 2131 // an accessibility mode change but the frame is persisting. |
2123 render_accessibility_->DisableAccessibility(); | 2132 render_accessibility_->DisableAccessibility(); |
2124 | 2133 |
(...skipping 4415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6540 // event target. Potentially a Pepper plugin will receive the event. | 6549 // event target. Potentially a Pepper plugin will receive the event. |
6541 // In order to tell whether a plugin gets the last mouse event and which it | 6550 // In order to tell whether a plugin gets the last mouse event and which it |
6542 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6551 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6543 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6552 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6544 // |pepper_last_mouse_event_target_|. | 6553 // |pepper_last_mouse_event_target_|. |
6545 pepper_last_mouse_event_target_ = nullptr; | 6554 pepper_last_mouse_event_target_ = nullptr; |
6546 #endif | 6555 #endif |
6547 } | 6556 } |
6548 | 6557 |
6549 } // namespace content | 6558 } // namespace content |
OLD | NEW |