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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 1313883002: Introduce firstRangeOf() as replacement of VisibleSelection::firstRange() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-25T17:47:14 Created 5 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 unified diff | Download patch
« no previous file with comments | « Source/web/TextFinder.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after
2363 if (!focused->editor().canEdit()) 2363 if (!focused->editor().canEdit())
2364 return info; 2364 return info;
2365 2365
2366 // Emits an object replacement character for each replaced element so that 2366 // Emits an object replacement character for each replaced element so that
2367 // it is exposed to IME and thus could be deleted by IME on android. 2367 // it is exposed to IME and thus could be deleted by IME on android.
2368 info.value = plainText(EphemeralRange::rangeOfContents(*element), TextIterat orEmitsObjectReplacementCharacter); 2368 info.value = plainText(EphemeralRange::rangeOfContents(*element), TextIterat orEmitsObjectReplacementCharacter);
2369 2369
2370 if (info.value.isEmpty()) 2370 if (info.value.isEmpty())
2371 return info; 2371 return info;
2372 2372
2373 if (RefPtrWillBeRawPtr<Range> range = selection.selection().firstRange()) { 2373 if (RefPtrWillBeRawPtr<Range> range = firstRangeOf(selection.selection())) {
2374 PlainTextRange plainTextRange(PlainTextRange::create(*element, *range.ge t())); 2374 PlainTextRange plainTextRange(PlainTextRange::create(*element, *range.ge t()));
2375 if (plainTextRange.isNotNull()) { 2375 if (plainTextRange.isNotNull()) {
2376 info.selectionStart = plainTextRange.start(); 2376 info.selectionStart = plainTextRange.start();
2377 info.selectionEnd = plainTextRange.end(); 2377 info.selectionEnd = plainTextRange.end();
2378 } 2378 }
2379 } 2379 }
2380 2380
2381 EphemeralRange range = focused->inputMethodController().compositionEphemeral Range(); 2381 EphemeralRange range = focused->inputMethodController().compositionEphemeral Range();
2382 if (range.isNotNull()) { 2382 if (range.isNotNull()) {
2383 PlainTextRange plainTextRange(PlainTextRange::create(*element, range)); 2383 PlainTextRange plainTextRange(PlainTextRange::create(*element, range));
(...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after
4416 if (m_pageColorOverlay) 4416 if (m_pageColorOverlay)
4417 m_pageColorOverlay->update(); 4417 m_pageColorOverlay->update();
4418 if (m_inspectorOverlay) { 4418 if (m_inspectorOverlay) {
4419 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); 4419 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay();
4420 if (inspectorPageOverlay) 4420 if (inspectorPageOverlay)
4421 inspectorPageOverlay->update(); 4421 inspectorPageOverlay->update();
4422 } 4422 }
4423 } 4423 }
4424 4424
4425 } // namespace blink 4425 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/TextFinder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698