| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 m_frame.document()->markers().removeMarkers(DocumentMarker::Spelling); | 817 m_frame.document()->markers().removeMarkers(DocumentMarker::Spelling); |
| 818 if (!isContinuousGrammarCheckingEnabled) | 818 if (!isContinuousGrammarCheckingEnabled) |
| 819 m_frame.document()->markers().removeMarkers(DocumentMarker::Grammar); | 819 m_frame.document()->markers().removeMarkers(DocumentMarker::Grammar); |
| 820 } | 820 } |
| 821 | 821 |
| 822 void SpellChecker::removeSpellingMarkers() | 822 void SpellChecker::removeSpellingMarkers() |
| 823 { | 823 { |
| 824 m_frame.document()->markers().removeMarkers(DocumentMarker::MisspellingMarke
rs()); | 824 m_frame.document()->markers().removeMarkers(DocumentMarker::MisspellingMarke
rs()); |
| 825 } | 825 } |
| 826 | 826 |
| 827 void SpellChecker::removeSpellingMarkersUnderWords(const Vector<String>& words) |
| 828 { |
| 829 Document& document = *m_frame.document(); |
| 830 DocumentMarkerController& markerController = document.markers(); |
| 831 |
| 832 MarkerRemoverPredicate removerPredicate(document, words); |
| 833 markerController.removeMarkers(removerPredicate); |
| 834 |
| 835 markerController.repaintMarkers(); |
| 836 } |
| 837 |
| 827 void SpellChecker::spellCheckAfterBlur() | 838 void SpellChecker::spellCheckAfterBlur() |
| 828 { | 839 { |
| 829 if (!m_frame.selection().selection().isContentEditable()) | 840 if (!m_frame.selection().selection().isContentEditable()) |
| 830 return; | 841 return; |
| 831 | 842 |
| 832 if (isSelectionInTextField(m_frame.selection().selection())) { | 843 if (isSelectionInTextField(m_frame.selection().selection())) { |
| 833 // textFieldDidEndEditing() and textFieldDidBeginEditing() handle this. | 844 // textFieldDidEndEditing() and textFieldDidBeginEditing() handle this. |
| 834 return; | 845 return; |
| 835 } | 846 } |
| 836 | 847 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 } | 929 } |
| 919 | 930 |
| 920 void SpellChecker::requestTextChecking(const Element& element) | 931 void SpellChecker::requestTextChecking(const Element& element) |
| 921 { | 932 { |
| 922 RefPtrWillBeRawPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element*
>(&element)); | 933 RefPtrWillBeRawPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element*
>(&element)); |
| 923 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec
kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe
ck, rangeToCheck)); | 934 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec
kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe
ck, rangeToCheck)); |
| 924 } | 935 } |
| 925 | 936 |
| 926 | 937 |
| 927 } // namespace blink | 938 } // namespace blink |
| OLD | NEW |