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

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

Issue 1332823002: Introduce firstEphemeralRangeOf(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: simplify firstRangeOf Created 5 years, 3 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/core/editing/VisibleSelection.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 2338 matching lines...) Expand 10 before | Expand all | Expand 10 after
2349 if (!focused->editor().canEdit()) 2349 if (!focused->editor().canEdit())
2350 return info; 2350 return info;
2351 2351
2352 // Emits an object replacement character for each replaced element so that 2352 // Emits an object replacement character for each replaced element so that
2353 // it is exposed to IME and thus could be deleted by IME on android. 2353 // it is exposed to IME and thus could be deleted by IME on android.
2354 info.value = plainText(EphemeralRange::rangeOfContents(*element), TextIterat orEmitsObjectReplacementCharacter); 2354 info.value = plainText(EphemeralRange::rangeOfContents(*element), TextIterat orEmitsObjectReplacementCharacter);
2355 2355
2356 if (info.value.isEmpty()) 2356 if (info.value.isEmpty())
2357 return info; 2357 return info;
2358 2358
2359 if (RefPtrWillBeRawPtr<Range> range = firstRangeOf(selection.selection())) { 2359 EphemeralRange firstRange = firstEphemeralRangeOf(selection.selection());
2360 PlainTextRange plainTextRange(PlainTextRange::create(*element, *range.ge t())); 2360 if (firstRange.isNotNull()) {
2361 PlainTextRange plainTextRange(PlainTextRange::create(*element, firstRang e));
2361 if (plainTextRange.isNotNull()) { 2362 if (plainTextRange.isNotNull()) {
2362 info.selectionStart = plainTextRange.start(); 2363 info.selectionStart = plainTextRange.start();
2363 info.selectionEnd = plainTextRange.end(); 2364 info.selectionEnd = plainTextRange.end();
2364 } 2365 }
2365 } 2366 }
2366 2367
2367 EphemeralRange range = focused->inputMethodController().compositionEphemeral Range(); 2368 EphemeralRange range = focused->inputMethodController().compositionEphemeral Range();
2368 if (range.isNotNull()) { 2369 if (range.isNotNull()) {
2369 PlainTextRange plainTextRange(PlainTextRange::create(*element, range)); 2370 PlainTextRange plainTextRange(PlainTextRange::create(*element, range));
2370 if (plainTextRange.isNotNull()) { 2371 if (plainTextRange.isNotNull()) {
(...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after
4411 if (m_pageColorOverlay) 4412 if (m_pageColorOverlay)
4412 m_pageColorOverlay->update(); 4413 m_pageColorOverlay->update();
4413 if (InspectorOverlayImpl* overlay = inspectorOverlay()) { 4414 if (InspectorOverlayImpl* overlay = inspectorOverlay()) {
4414 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); 4415 PageOverlay* inspectorPageOverlay = overlay->pageOverlay();
4415 if (inspectorPageOverlay) 4416 if (inspectorPageOverlay)
4416 inspectorPageOverlay->update(); 4417 inspectorPageOverlay->update();
4417 } 4418 }
4418 } 4419 }
4419 4420
4420 } // namespace blink 4421 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/editing/VisibleSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698