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

Unified Diff: Source/core/editing/Editor.cpp

Issue 15179002: Remove code that is unused after ContextMenu cleanup (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove canHandleRequest code from DRT Created 7 years, 7 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 | « Source/core/editing/Editor.h ('k') | Source/core/editing/TextCheckingHelper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/Editor.cpp
diff --git a/Source/core/editing/Editor.cpp b/Source/core/editing/Editor.cpp
index 733cc6cb6324475a070b3b58e102368e680625d5..03780156c8b22ef6cf71480f7cd52ffd1015db91 100644
--- a/Source/core/editing/Editor.cpp
+++ b/Source/core/editing/Editor.cpp
@@ -482,34 +482,6 @@ void Editor::respondToChangedContents(const VisibleSelection& endingSelection)
client()->respondToChangedContents();
}
-bool Editor::hasBidiSelection() const
-{
- if (m_frame->selection()->isNone())
- return false;
-
- Node* startNode;
- if (m_frame->selection()->isRange()) {
- startNode = m_frame->selection()->selection().start().downstream().deprecatedNode();
- Node* endNode = m_frame->selection()->selection().end().upstream().deprecatedNode();
- if (enclosingBlock(startNode) != enclosingBlock(endNode))
- return false;
- } else
- startNode = m_frame->selection()->selection().visibleStart().deepEquivalent().deprecatedNode();
-
- RenderObject* renderer = startNode->renderer();
- while (renderer && !renderer->isRenderBlock())
- renderer = renderer->parent();
-
- if (!renderer)
- return false;
-
- RenderStyle* style = renderer->style();
- if (!style->isLeftToRightDirection())
- return true;
-
- return toRenderBlock(renderer)->containsNonZeroBidiLevel();
-}
-
TriState Editor::selectionUnorderedListState() const
{
if (m_frame->selection()->isCaret()) {
@@ -1104,16 +1076,6 @@ void Editor::didEndEditing()
client()->didEndEditing();
}
-void Editor::toggleBold()
-{
- command("ToggleBold").execute();
-}
-
-void Editor::toggleUnderline()
-{
- command("ToggleUnderline").execute();
-}
-
void Editor::setBaseWritingDirection(WritingDirection direction)
{
Node* focusedNode = frame()->document()->focusedNode();
@@ -1356,16 +1318,6 @@ void Editor::ignoreSpelling()
frame()->document()->markers()->removeMarkers(selectedRange.get(), DocumentMarker::Spelling);
}
-void Editor::learnSpelling()
-{
- if (!client())
- return;
-
- RefPtr<Range> selectedRange = frame()->selection()->toNormalizedRange();
- if (selectedRange)
- frame()->document()->markers()->removeMarkers(selectedRange.get(), DocumentMarker::Spelling);
-}
-
void Editor::advanceToNextMisspelling(bool startBeforeSelection)
{
// The basic approach is to search in two phases - from the selection end to the end of the doc, and
@@ -1556,74 +1508,6 @@ String Editor::misspelledWordAtCaretOrRange(Node* clickedNode) const
return misspellingLength == wordLength ? word : String();
}
-String Editor::misspelledSelectionString() const
-{
- String selectedString = selectedText();
- int length = selectedString.length();
- if (!length || !client())
- return String();
-
- int misspellingLocation = -1;
- int misspellingLength = 0;
- textChecker()->checkSpellingOfString(selectedString.characters(), length, &misspellingLocation, &misspellingLength);
-
- // The selection only counts as misspelled if the selected text is exactly one misspelled word
- if (misspellingLength != length)
- return String();
-
- // Update the spelling panel to be displaying this error (whether or not the spelling panel is on screen).
- // This is necessary to make a subsequent call to [NSSpellChecker ignoreWord:inSpellDocumentWithTag:] work
- // correctly; that call behaves differently based on whether the spelling panel is displaying a misspelling
- // or a grammar error.
- client()->updateSpellingUIWithMisspelledWord(selectedString);
-
- return selectedString;
-}
-
-bool Editor::isSelectionUngrammatical()
-{
- Vector<String> ignoredGuesses;
- RefPtr<Range> range = frame()->selection()->toNormalizedRange();
- if (!range)
- return false;
- return TextCheckingHelper(client(), range).isUngrammatical(ignoredGuesses);
-}
-
-Vector<String> Editor::guessesForUngrammaticalSelection()
-{
- Vector<String> guesses;
- RefPtr<Range> range = frame()->selection()->toNormalizedRange();
- if (!range)
- return guesses;
- // Ignore the result of isUngrammatical; we just want the guesses, whether or not there are any
- TextCheckingHelper(client(), range).isUngrammatical(guesses);
- return guesses;
-}
-
-Vector<String> Editor::guessesForMisspelledOrUngrammatical(bool& misspelled, bool& ungrammatical)
-{
- if (unifiedTextCheckerEnabled()) {
- FrameSelection* frameSelection = frame()->selection();
- if (RefPtr<Range> range = frameSelection->toNormalizedRange())
- return TextCheckingHelper(client(), range).guessesForMisspelledOrUngrammaticalRange(isGrammarCheckingEnabled(), misspelled, ungrammatical);
- return Vector<String>();
- }
-
- String misspelledWord = misspelledSelectionString();
- misspelled = !misspelledWord.isEmpty();
-
- if (misspelled) {
- ungrammatical = false;
- return Vector<String>();
- }
- if (isGrammarCheckingEnabled() && isSelectionUngrammatical()) {
- ungrammatical = true;
- return guessesForUngrammaticalSelection();
- }
- ungrammatical = false;
- return Vector<String>();
-}
-
void Editor::showSpellingGuessPanel()
{
if (!client()) {
@@ -1640,13 +1524,6 @@ void Editor::showSpellingGuessPanel()
client()->showSpellingUI(true);
}
-bool Editor::spellingPanelIsShowing()
-{
- if (!client())
- return false;
- return client()->spellingUIIsShowing();
-}
-
void Editor::clearMisspellingsAndBadGrammar(const VisibleSelection &movingSelection)
{
RefPtr<Range> selectedRange = movingSelection.toNormalizedRange();
« no previous file with comments | « Source/core/editing/Editor.h ('k') | Source/core/editing/TextCheckingHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698