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 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 OnAdjustSelectionByCharacterOffset) | 1524 OnAdjustSelectionByCharacterOffset) |
1525 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect) | 1525 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect) |
1526 IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent, | 1526 IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent, |
1527 OnMoveRangeSelectionExtent) | 1527 OnMoveRangeSelectionExtent) |
1528 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace) | 1528 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace) |
1529 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling) | 1529 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling) |
1530 IPC_MESSAGE_HANDLER(FrameMsg_CopyImageAt, OnCopyImageAt) | 1530 IPC_MESSAGE_HANDLER(FrameMsg_CopyImageAt, OnCopyImageAt) |
1531 IPC_MESSAGE_HANDLER(FrameMsg_SaveImageAt, OnSaveImageAt) | 1531 IPC_MESSAGE_HANDLER(FrameMsg_SaveImageAt, OnSaveImageAt) |
1532 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete, | 1532 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete, |
1533 OnExtendSelectionAndDelete) | 1533 OnExtendSelectionAndDelete) |
| 1534 IPC_MESSAGE_HANDLER(InputMsg_DeleteSurroundingText, OnDeleteSurroundingText) |
1534 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText, | 1535 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText, |
1535 OnSetCompositionFromExistingText) | 1536 OnSetCompositionFromExistingText) |
1536 IPC_MESSAGE_HANDLER(InputMsg_SetEditableSelectionOffsets, | 1537 IPC_MESSAGE_HANDLER(InputMsg_SetEditableSelectionOffsets, |
1537 OnSetEditableSelectionOffsets) | 1538 OnSetEditableSelectionOffsets) |
1538 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand, | 1539 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand, |
1539 OnExecuteNoValueEditCommand) | 1540 OnExecuteNoValueEditCommand) |
1540 IPC_MESSAGE_HANDLER(FrameMsg_CSSInsertRequest, OnCSSInsertRequest) | 1541 IPC_MESSAGE_HANDLER(FrameMsg_CSSInsertRequest, OnCSSInsertRequest) |
1541 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole) | 1542 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole) |
1542 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest, | 1543 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest, |
1543 OnJavaScriptExecuteRequest) | 1544 OnJavaScriptExecuteRequest) |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2098 } | 2099 } |
2099 | 2100 |
2100 void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) { | 2101 void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) { |
2101 if (!GetRenderWidget()->ShouldHandleImeEvent()) | 2102 if (!GetRenderWidget()->ShouldHandleImeEvent()) |
2102 return; | 2103 return; |
2103 | 2104 |
2104 ImeEventGuard guard(GetRenderWidget()); | 2105 ImeEventGuard guard(GetRenderWidget()); |
2105 frame_->extendSelectionAndDelete(before, after); | 2106 frame_->extendSelectionAndDelete(before, after); |
2106 } | 2107 } |
2107 | 2108 |
| 2109 void RenderFrameImpl::OnDeleteSurroundingText(int before, int after) { |
| 2110 if (!GetRenderWidget()->ShouldHandleImeEvent()) |
| 2111 return; |
| 2112 |
| 2113 ImeEventGuard guard(GetRenderWidget()); |
| 2114 frame_->deleteSurroundingText(before, after); |
| 2115 } |
| 2116 |
2108 void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { | 2117 void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { |
2109 if (accessibility_mode_ == new_mode) | 2118 if (accessibility_mode_ == new_mode) |
2110 return; | 2119 return; |
2111 accessibility_mode_ = new_mode; | 2120 accessibility_mode_ = new_mode; |
2112 if (render_accessibility_) { | 2121 if (render_accessibility_) { |
2113 // Note: this isn't called automatically by the destructor because | 2122 // Note: this isn't called automatically by the destructor because |
2114 // there'd be no point in calling it in frame teardown, only if there's | 2123 // there'd be no point in calling it in frame teardown, only if there's |
2115 // an accessibility mode change but the frame is persisting. | 2124 // an accessibility mode change but the frame is persisting. |
2116 render_accessibility_->DisableAccessibility(); | 2125 render_accessibility_->DisableAccessibility(); |
2117 | 2126 |
(...skipping 4248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6366 // event target. Potentially a Pepper plugin will receive the event. | 6375 // event target. Potentially a Pepper plugin will receive the event. |
6367 // In order to tell whether a plugin gets the last mouse event and which it | 6376 // In order to tell whether a plugin gets the last mouse event and which it |
6368 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6377 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6369 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6378 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6370 // |pepper_last_mouse_event_target_|. | 6379 // |pepper_last_mouse_event_target_|. |
6371 pepper_last_mouse_event_target_ = nullptr; | 6380 pepper_last_mouse_event_target_ = nullptr; |
6372 #endif | 6381 #endif |
6373 } | 6382 } |
6374 | 6383 |
6375 } // namespace content | 6384 } // namespace content |
OLD | NEW |