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

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: Change some comments. Created 4 years, 6 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 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 IPC_MESSAGE_HANDLER(InputMsg_SelectRange, OnSelectRange) 1494 IPC_MESSAGE_HANDLER(InputMsg_SelectRange, OnSelectRange)
1495 IPC_MESSAGE_HANDLER(InputMsg_AdjustSelectionByCharacterOffset, 1495 IPC_MESSAGE_HANDLER(InputMsg_AdjustSelectionByCharacterOffset,
1496 OnAdjustSelectionByCharacterOffset) 1496 OnAdjustSelectionByCharacterOffset)
1497 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect) 1497 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect)
1498 IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent, 1498 IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent,
1499 OnMoveRangeSelectionExtent) 1499 OnMoveRangeSelectionExtent)
1500 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace) 1500 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace)
1501 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling) 1501 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling)
1502 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete, 1502 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete,
1503 OnExtendSelectionAndDelete) 1503 OnExtendSelectionAndDelete)
1504 IPC_MESSAGE_HANDLER(InputMsg_DeleteSurroundingText, OnDeleteSurroundingText)
1504 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText, 1505 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText,
1505 OnSetCompositionFromExistingText) 1506 OnSetCompositionFromExistingText)
1506 IPC_MESSAGE_HANDLER(InputMsg_SetEditableSelectionOffsets, 1507 IPC_MESSAGE_HANDLER(InputMsg_SetEditableSelectionOffsets,
1507 OnSetEditableSelectionOffsets) 1508 OnSetEditableSelectionOffsets)
1508 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand, 1509 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand,
1509 OnExecuteNoValueEditCommand) 1510 OnExecuteNoValueEditCommand)
1510 IPC_MESSAGE_HANDLER(FrameMsg_CSSInsertRequest, OnCSSInsertRequest) 1511 IPC_MESSAGE_HANDLER(FrameMsg_CSSInsertRequest, OnCSSInsertRequest)
1511 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole) 1512 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole)
1512 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest, 1513 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest,
1513 OnJavaScriptExecuteRequest) 1514 OnJavaScriptExecuteRequest)
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
2067 } 2068 }
2068 2069
2069 void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) { 2070 void RenderFrameImpl::OnExtendSelectionAndDelete(int before, int after) {
2070 if (!GetRenderWidget()->ShouldHandleImeEvent()) 2071 if (!GetRenderWidget()->ShouldHandleImeEvent())
2071 return; 2072 return;
2072 2073
2073 ImeEventGuard guard(GetRenderWidget()); 2074 ImeEventGuard guard(GetRenderWidget());
2074 frame_->extendSelectionAndDelete(before, after); 2075 frame_->extendSelectionAndDelete(before, after);
2075 } 2076 }
2076 2077
2078 void RenderFrameImpl::OnDeleteSurroundingText(int before, int after) {
2079 if (!GetRenderWidget()->ShouldHandleImeEvent())
2080 return;
2081
2082 ImeEventGuard guard(GetRenderWidget());
2083 frame_->deleteSurroundingText(before, after);
2084 }
2085
2077 void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { 2086 void RenderFrameImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) {
2078 if (accessibility_mode_ == new_mode) 2087 if (accessibility_mode_ == new_mode)
2079 return; 2088 return;
2080 accessibility_mode_ = new_mode; 2089 accessibility_mode_ = new_mode;
2081 if (renderer_accessibility_) { 2090 if (renderer_accessibility_) {
2082 // Note: this isn't called automatically by the destructor because 2091 // Note: this isn't called automatically by the destructor because
2083 // there'd be no point in calling it in frame teardown, only if there's 2092 // there'd be no point in calling it in frame teardown, only if there's
2084 // an accessibility mode change but the frame is persisting. 2093 // an accessibility mode change but the frame is persisting.
2085 renderer_accessibility_->DisableAccessibility(); 2094 renderer_accessibility_->DisableAccessibility();
2086 2095
(...skipping 4168 matching lines...) Expand 10 before | Expand all | Expand 10 after
6255 // event target. Potentially a Pepper plugin will receive the event. 6264 // event target. Potentially a Pepper plugin will receive the event.
6256 // In order to tell whether a plugin gets the last mouse event and which it 6265 // In order to tell whether a plugin gets the last mouse event and which it
6257 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6266 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6258 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6267 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6259 // |pepper_last_mouse_event_target_|. 6268 // |pepper_last_mouse_event_target_|.
6260 pepper_last_mouse_event_target_ = nullptr; 6269 pepper_last_mouse_event_target_ = nullptr;
6261 #endif 6270 #endif
6262 } 6271 }
6263 6272
6264 } // namespace content 6273 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698