Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1889053003: Fix InputConnection.deleteSurroundingText() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 OnAdjustSelectionByCharacterOffset) 1533 OnAdjustSelectionByCharacterOffset)
1534 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect) 1534 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect)
1535 IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent, 1535 IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent,
1536 OnMoveRangeSelectionExtent) 1536 OnMoveRangeSelectionExtent)
1537 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace) 1537 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace)
1538 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling) 1538 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling)
1539 IPC_MESSAGE_HANDLER(FrameMsg_CopyImageAt, OnCopyImageAt) 1539 IPC_MESSAGE_HANDLER(FrameMsg_CopyImageAt, OnCopyImageAt)
1540 IPC_MESSAGE_HANDLER(FrameMsg_SaveImageAt, OnSaveImageAt) 1540 IPC_MESSAGE_HANDLER(FrameMsg_SaveImageAt, OnSaveImageAt)
1541 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete, 1541 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete,
1542 OnExtendSelectionAndDelete) 1542 OnExtendSelectionAndDelete)
1543 IPC_MESSAGE_HANDLER(InputMsg_DeleteSurroundingText, OnDeleteSurroundingText)
1543 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText, 1544 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText,
1544 OnSetCompositionFromExistingText) 1545 OnSetCompositionFromExistingText)
1545 IPC_MESSAGE_HANDLER(InputMsg_SetEditableSelectionOffsets, 1546 IPC_MESSAGE_HANDLER(InputMsg_SetEditableSelectionOffsets,
1546 OnSetEditableSelectionOffsets) 1547 OnSetEditableSelectionOffsets)
1547 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand, 1548 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand,
1548 OnExecuteNoValueEditCommand) 1549 OnExecuteNoValueEditCommand)
1549 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole) 1550 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole)
1550 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest, 1551 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest,
1551 OnJavaScriptExecuteRequest) 1552 OnJavaScriptExecuteRequest)
1552 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests, 1553 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests,
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 } 2100 }
2100 2101
2101 void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) { 2102 void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) {
2102 if (!GetRenderWidget()->ShouldHandleImeEvent()) 2103 if (!GetRenderWidget()->ShouldHandleImeEvent())
2103 return; 2104 return;
2104 2105
2105 ImeEventGuard guard(GetRenderWidget()); 2106 ImeEventGuard guard(GetRenderWidget());
2106 frame_->extendSelectionAndDelete(before, after); 2107 frame_->extendSelectionAndDelete(before, after);
2107 } 2108 }
2108 2109
2110 void RenderFrameImpl::OnDeleteSurroundingText(int before, int after) {
2111 if (!GetRenderWidget()->ShouldHandleImeEvent())
2112 return;
2113
2114 ImeEventGuard guard(GetRenderWidget());
2115 frame_->deleteSurroundingText(before, after);
2116 }
2117
2109 void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { 2118 void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) {
2110 if (accessibility_mode_ == new_mode) 2119 if (accessibility_mode_ == new_mode)
2111 return; 2120 return;
2112 accessibility_mode_ = new_mode; 2121 accessibility_mode_ = new_mode;
2113 if (render_accessibility_) { 2122 if (render_accessibility_) {
2114 // Note: this isn't called automatically by the destructor because 2123 // Note: this isn't called automatically by the destructor because
2115 // there'd be no point in calling it in frame teardown, only if there's 2124 // there'd be no point in calling it in frame teardown, only if there's
2116 // an accessibility mode change but the frame is persisting. 2125 // an accessibility mode change but the frame is persisting.
2117 render_accessibility_->DisableAccessibility(); 2126 render_accessibility_->DisableAccessibility();
2118 2127
(...skipping 4376 matching lines...) Expand 10 before | Expand all | Expand 10 after
6495 // event target. Potentially a Pepper plugin will receive the event. 6504 // event target. Potentially a Pepper plugin will receive the event.
6496 // In order to tell whether a plugin gets the last mouse event and which it 6505 // In order to tell whether a plugin gets the last mouse event and which it
6497 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6506 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6498 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6507 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6499 // |pepper_last_mouse_event_target_|. 6508 // |pepper_last_mouse_event_target_|.
6500 pepper_last_mouse_event_target_ = nullptr; 6509 pepper_last_mouse_event_target_ = nullptr;
6501 #endif 6510 #endif
6502 } 6511 }
6503 6512
6504 } // namespace content 6513 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698