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

Side by Side Diff: third_party/WebKit/Source/core/editing/FrameSelection.cpp

Issue 1427733003: Use |FrameSelection::selectedText()| where possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 return createMarkup(range.startPosition(), range.endPosition(), AnnotateForI nterchange, ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); 1136 return createMarkup(range.startPosition(), range.endPosition(), AnnotateForI nterchange, ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
1137 } 1137 }
1138 1138
1139 String FrameSelection::selectedHTMLForClipboard() const 1139 String FrameSelection::selectedHTMLForClipboard() const
1140 { 1140 {
1141 if (!RuntimeEnabledFeatures::selectionForComposedTreeEnabled()) 1141 if (!RuntimeEnabledFeatures::selectionForComposedTreeEnabled())
1142 return extractSelectedHTMLAlgorithm<EditingStrategy>(*this); 1142 return extractSelectedHTMLAlgorithm<EditingStrategy>(*this);
1143 return extractSelectedHTMLAlgorithm<EditingInComposedTreeStrategy>(*this); 1143 return extractSelectedHTMLAlgorithm<EditingInComposedTreeStrategy>(*this);
1144 } 1144 }
1145 1145
1146 String FrameSelection::selectedText() const 1146 String FrameSelection::selectedText(TextIteratorBehavior behavior) const
1147 { 1147 {
1148 return extractSelectedText(*this, TextIteratorDefaultBehavior); 1148 return extractSelectedText(*this, behavior);
1149 } 1149 }
1150 1150
1151 String FrameSelection::selectedTextForClipboard() const 1151 String FrameSelection::selectedTextForClipboard() const
1152 { 1152 {
1153 if (m_frame->settings() && m_frame->settings()->selectionIncludesAltImageTex t()) 1153 if (m_frame->settings() && m_frame->settings()->selectionIncludesAltImageTex t())
1154 return extractSelectedText(*this, TextIteratorEmitsImageAltText); 1154 return extractSelectedText(*this, TextIteratorEmitsImageAltText);
1155 return selectedText(); 1155 return selectedText();
1156 } 1156 }
1157 1157
1158 LayoutRect FrameSelection::bounds() const 1158 LayoutRect FrameSelection::bounds() const
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 1409
1410 void showTree(const blink::FrameSelection* sel) 1410 void showTree(const blink::FrameSelection* sel)
1411 { 1411 {
1412 if (sel) 1412 if (sel)
1413 sel->showTreeForThis(); 1413 sel->showTreeForThis();
1414 else 1414 else
1415 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); 1415 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n");
1416 } 1416 }
1417 1417
1418 #endif 1418 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698