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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2199523002: Convert WebRange to be a simple pair of numbers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forgot the exports. Created 4 years, 4 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
« no previous file with comments | « components/printing/test/print_web_view_helper_browsertest.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « components/printing/test/print_web_view_helper_browsertest.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698