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

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: deleteContents doesn’t work well for multiple nodes. Created 4 years, 7 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 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 IPC_MESSAGE_HANDLER(InputMsg_SelectRange, OnSelectRange) 1497 IPC_MESSAGE_HANDLER(InputMsg_SelectRange, OnSelectRange)
1498 IPC_MESSAGE_HANDLER(InputMsg_AdjustSelectionByCharacterOffset, 1498 IPC_MESSAGE_HANDLER(InputMsg_AdjustSelectionByCharacterOffset,
1499 OnAdjustSelectionByCharacterOffset) 1499 OnAdjustSelectionByCharacterOffset)
1500 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect) 1500 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect)
1501 IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent, 1501 IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent,
1502 OnMoveRangeSelectionExtent) 1502 OnMoveRangeSelectionExtent)
1503 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace) 1503 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace)
1504 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling) 1504 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling)
1505 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete, 1505 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete,
1506 OnExtendSelectionAndDelete) 1506 OnExtendSelectionAndDelete)
1507 IPC_MESSAGE_HANDLER(InputMsg_DeleteSurroundingText, OnDeleteSurroundingText)
1507 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText, 1508 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText,
1508 OnSetCompositionFromExistingText) 1509 OnSetCompositionFromExistingText)
1509 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand, 1510 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand,
1510 OnExecuteNoValueEditCommand) 1511 OnExecuteNoValueEditCommand)
1511 IPC_MESSAGE_HANDLER(FrameMsg_CSSInsertRequest, OnCSSInsertRequest) 1512 IPC_MESSAGE_HANDLER(FrameMsg_CSSInsertRequest, OnCSSInsertRequest)
1512 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole) 1513 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole)
1513 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest, 1514 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest,
1514 OnJavaScriptExecuteRequest) 1515 OnJavaScriptExecuteRequest)
1515 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests, 1516 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests,
1516 OnJavaScriptExecuteRequestForTests) 1517 OnJavaScriptExecuteRequestForTests)
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 } 2060 }
2060 2061
2061 void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) { 2062 void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) {
2062 if (!GetRenderWidget()->ShouldHandleImeEvent()) 2063 if (!GetRenderWidget()->ShouldHandleImeEvent())
2063 return; 2064 return;
2064 2065
2065 ImeEventGuard guard(GetRenderWidget()); 2066 ImeEventGuard guard(GetRenderWidget());
2066 frame_->extendSelectionAndDelete(before, after); 2067 frame_->extendSelectionAndDelete(before, after);
2067 } 2068 }
2068 2069
2070 void RenderFrameImpl::OnDeleteSurroundingText(int before, int after) {
2071 if (!GetRenderWidget()->ShouldHandleImeEvent())
2072 return;
2073
2074 ImeEventGuard guard(GetRenderWidget());
2075 frame_->deleteSurroundingText(before, after);
2076 }
2077
2069 void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { 2078 void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) {
2070 if (accessibility_mode_ == new_mode) 2079 if (accessibility_mode_ == new_mode)
2071 return; 2080 return;
2072 accessibility_mode_ = new_mode; 2081 accessibility_mode_ = new_mode;
2073 if (renderer_accessibility_) { 2082 if (renderer_accessibility_) {
2074 // Note: this isn't called automatically by the destructor because 2083 // Note: this isn't called automatically by the destructor because
2075 // there'd be no point in calling it in frame teardown, only if there's 2084 // there'd be no point in calling it in frame teardown, only if there's
2076 // an accessibility mode change but the frame is persisting. 2085 // an accessibility mode change but the frame is persisting.
2077 renderer_accessibility_->DisableAccessibility(); 2086 renderer_accessibility_->DisableAccessibility();
2078 2087
(...skipping 4125 matching lines...) Expand 10 before | Expand all | Expand 10 after
6204 // event target. Potentially a Pepper plugin will receive the event. 6213 // event target. Potentially a Pepper plugin will receive the event.
6205 // In order to tell whether a plugin gets the last mouse event and which it 6214 // In order to tell whether a plugin gets the last mouse event and which it
6206 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6215 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6207 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6216 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6208 // |pepper_last_mouse_event_target_|. 6217 // |pepper_last_mouse_event_target_|.
6209 pepper_last_mouse_event_target_ = nullptr; 6218 pepper_last_mouse_event_target_ = nullptr;
6210 #endif 6219 #endif
6211 } 6220 }
6212 6221
6213 } // namespace content 6222 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698