| Index: content/renderer/render_frame_impl.cc
|
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
| index 9fb4467fa3001951d3bbc3694a09ca2bc32629fe..6e2f5fc1ae75f1eed63c93cec6ea8097ff1193c9 100644
|
| --- a/content/renderer/render_frame_impl.cc
|
| +++ b/content/renderer/render_frame_impl.cc
|
| @@ -1880,7 +1880,7 @@ void RenderFrameImpl::OnAdjustSelectionByCharacterOffset(int start_adjust,
|
| length += end_adjust - start_adjust;
|
|
|
| base::AutoReset<bool> handling_select_range(&handling_select_range_, true);
|
| - frame_->selectRange(WebRange::fromDocumentRange(frame_, start, length));
|
| + frame_->selectRange(WebRange(start, length));
|
| }
|
|
|
| void RenderFrameImpl::OnUnselect() {
|
| @@ -2248,7 +2248,7 @@ void RenderFrameImpl::OnReloadLoFiImages() {
|
|
|
| void RenderFrameImpl::OnTextSurroundingSelectionRequest(uint32_t max_length) {
|
| blink::WebSurroundingText surroundingText;
|
| - surroundingText.initialize(frame_->selectionRange(), max_length);
|
| + surroundingText.initializeFromCurrentSelection(frame_, max_length);
|
|
|
| if (surroundingText.isNull()) {
|
| // |surroundingText| might not be correctly initialized, for example if
|
| @@ -5679,9 +5679,7 @@ void RenderFrameImpl::SyncSelectionIfRequired() {
|
| else
|
| offset = 0;
|
| length = location + length - offset + kExtraCharsBeforeAndAfterSelection;
|
| - WebRange webrange = WebRange::fromDocumentRange(frame_, offset, length);
|
| - if (!webrange.isNull())
|
| - text = webrange.toPlainText();
|
| + text = frame_->rangeAsText(WebRange(offset, length));
|
| } else {
|
| offset = location;
|
| text = frame_->selectionAsText();
|
| @@ -5693,6 +5691,9 @@ void RenderFrameImpl::SyncSelectionIfRequired() {
|
| }
|
| }
|
|
|
| + // TODO(dglazkov): Investigate if and why this would be happening,
|
| + // and resolve this. We shouldn't be carrying selection text here.
|
| + // http://crbug.com/632920.
|
| // Sometimes we get repeated didChangeSelection calls from webkit when
|
| // the selection hasn't actually changed. We don't want to report these
|
| // because it will cause us to continually claim the X clipboard.
|
|
|