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 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 OnAdjustSelectionByCharacterOffset) | 1502 OnAdjustSelectionByCharacterOffset) |
1503 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect) | 1503 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect) |
1504 IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent, | 1504 IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent, |
1505 OnMoveRangeSelectionExtent) | 1505 OnMoveRangeSelectionExtent) |
1506 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace) | 1506 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace) |
1507 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling) | 1507 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling) |
1508 IPC_MESSAGE_HANDLER(FrameMsg_CopyImageAt, OnCopyImageAt) | 1508 IPC_MESSAGE_HANDLER(FrameMsg_CopyImageAt, OnCopyImageAt) |
1509 IPC_MESSAGE_HANDLER(FrameMsg_SaveImageAt, OnSaveImageAt) | 1509 IPC_MESSAGE_HANDLER(FrameMsg_SaveImageAt, OnSaveImageAt) |
1510 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete, | 1510 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete, |
1511 OnExtendSelectionAndDelete) | 1511 OnExtendSelectionAndDelete) |
| 1512 IPC_MESSAGE_HANDLER(InputMsg_DeleteSurroundingText, OnDeleteSurroundingText) |
1512 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText, | 1513 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText, |
1513 OnSetCompositionFromExistingText) | 1514 OnSetCompositionFromExistingText) |
1514 IPC_MESSAGE_HANDLER(InputMsg_SetEditableSelectionOffsets, | 1515 IPC_MESSAGE_HANDLER(InputMsg_SetEditableSelectionOffsets, |
1515 OnSetEditableSelectionOffsets) | 1516 OnSetEditableSelectionOffsets) |
1516 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand, | 1517 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand, |
1517 OnExecuteNoValueEditCommand) | 1518 OnExecuteNoValueEditCommand) |
1518 IPC_MESSAGE_HANDLER(FrameMsg_CSSInsertRequest, OnCSSInsertRequest) | 1519 IPC_MESSAGE_HANDLER(FrameMsg_CSSInsertRequest, OnCSSInsertRequest) |
1519 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole) | 1520 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole) |
1520 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest, | 1521 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest, |
1521 OnJavaScriptExecuteRequest) | 1522 OnJavaScriptExecuteRequest) |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2076 } | 2077 } |
2077 | 2078 |
2078 void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) { | 2079 void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) { |
2079 if (!GetRenderWidget()->ShouldHandleImeEvent()) | 2080 if (!GetRenderWidget()->ShouldHandleImeEvent()) |
2080 return; | 2081 return; |
2081 | 2082 |
2082 ImeEventGuard guard(GetRenderWidget()); | 2083 ImeEventGuard guard(GetRenderWidget()); |
2083 frame_->extendSelectionAndDelete(before, after); | 2084 frame_->extendSelectionAndDelete(before, after); |
2084 } | 2085 } |
2085 | 2086 |
| 2087 void RenderFrameImpl::OnDeleteSurroundingText(int before, int after) { |
| 2088 if (!GetRenderWidget()->ShouldHandleImeEvent()) |
| 2089 return; |
| 2090 |
| 2091 ImeEventGuard guard(GetRenderWidget()); |
| 2092 frame_->deleteSurroundingText(before, after); |
| 2093 } |
| 2094 |
2086 void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { | 2095 void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { |
2087 if (accessibility_mode_ == new_mode) | 2096 if (accessibility_mode_ == new_mode) |
2088 return; | 2097 return; |
2089 accessibility_mode_ = new_mode; | 2098 accessibility_mode_ = new_mode; |
2090 if (render_accessibility_) { | 2099 if (render_accessibility_) { |
2091 // Note: this isn't called automatically by the destructor because | 2100 // Note: this isn't called automatically by the destructor because |
2092 // there'd be no point in calling it in frame teardown, only if there's | 2101 // there'd be no point in calling it in frame teardown, only if there's |
2093 // an accessibility mode change but the frame is persisting. | 2102 // an accessibility mode change but the frame is persisting. |
2094 render_accessibility_->DisableAccessibility(); | 2103 render_accessibility_->DisableAccessibility(); |
2095 | 2104 |
(...skipping 4232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6328 // event target. Potentially a Pepper plugin will receive the event. | 6337 // event target. Potentially a Pepper plugin will receive the event. |
6329 // In order to tell whether a plugin gets the last mouse event and which it | 6338 // In order to tell whether a plugin gets the last mouse event and which it |
6330 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6339 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6331 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6340 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6332 // |pepper_last_mouse_event_target_|. | 6341 // |pepper_last_mouse_event_target_|. |
6333 pepper_last_mouse_event_target_ = nullptr; | 6342 pepper_last_mouse_event_target_ = nullptr; |
6334 #endif | 6343 #endif |
6335 } | 6344 } |
6336 | 6345 |
6337 } // namespace content | 6346 } // namespace content |
OLD | NEW |