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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2910223003: [refactor] - Rename and Move WebWidget::CaretOrSelectionRange to WebInputMethodController::GetSelec… (Closed)
Patch Set: Fixed some comments Created 3 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 8d9e7c0db0551b5830c9461a41bb228b5e4cc4e0..7ae5e43db7dbb6b9097291ed9317784682d8595b 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2023,7 +2023,7 @@ void RenderFrameImpl::OnSelectRange(const gfx::Point& base,
void RenderFrameImpl::OnAdjustSelectionByCharacterOffset(int start_adjust,
int end_adjust) {
- WebRange range = GetRenderWidget()->GetWebWidget()->CaretOrSelectionRange();
+ WebRange range = frame_->GetInputMethodController()->GetSelectionOffsets();
if (range.IsNull())
return;
@@ -2044,7 +2044,7 @@ void RenderFrameImpl::OnAdjustSelectionByCharacterOffset(int start_adjust,
void RenderFrameImpl::OnCollapseSelection() {
const WebRange& range =
- GetRenderWidget()->GetWebWidget()->CaretOrSelectionRange();
+ frame_->GetInputMethodController()->GetSelectionOffsets();
if (range.IsNull())
return;
@@ -6395,7 +6395,7 @@ void RenderFrameImpl::SyncSelectionIfRequired() {
#endif
{
WebRange selection =
- GetRenderWidget()->GetWebWidget()->CaretOrSelectionRange();
+ frame_->GetInputMethodController()->GetSelectionOffsets();
if (selection.IsNull())
return;
@@ -6418,9 +6418,8 @@ void RenderFrameImpl::SyncSelectionIfRequired() {
text = frame_->SelectionAsText().Utf16();
// http://crbug.com/101435
// In some case, frame->selectionAsText() returned text's length is not
- // equal to the length returned from
- // GetWebWidget()->caretOrSelectionRange().
- // So we have to set the range according to text.length().
+ // equal to the length returned from frame_->GetSelectionOffsets(). So we
+ // have to set the range according to text.length().
range.set_end(range.start() + text.length());
}
}

Powered by Google App Engine
This is Rietveld 408576698