| 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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 idle_spell_check_callback_->SetNeedsInvocation(); | 919 idle_spell_check_callback_->SetNeedsInvocation(); |
| 920 } | 920 } |
| 921 | 921 |
| 922 void SpellChecker::RemoveSpellingMarkers() { | 922 void SpellChecker::RemoveSpellingMarkers() { |
| 923 GetFrame().GetDocument()->Markers().RemoveMarkers( | 923 GetFrame().GetDocument()->Markers().RemoveMarkers( |
| 924 DocumentMarker::MisspellingMarkers()); | 924 DocumentMarker::MisspellingMarkers()); |
| 925 } | 925 } |
| 926 | 926 |
| 927 void SpellChecker::RemoveSpellingMarkersUnderWords( | 927 void SpellChecker::RemoveSpellingMarkersUnderWords( |
| 928 const Vector<String>& words) { | 928 const Vector<String>& words) { |
| 929 MarkerRemoverPredicate remover_predicate(words); | |
| 930 | |
| 931 DocumentMarkerController& marker_controller = | 929 DocumentMarkerController& marker_controller = |
| 932 GetFrame().GetDocument()->Markers(); | 930 GetFrame().GetDocument()->Markers(); |
| 933 marker_controller.RemoveMarkers(remover_predicate); | 931 marker_controller.RemoveSpellingMarkersUnderWords(words); |
| 934 marker_controller.RepaintMarkers(); | 932 marker_controller.RepaintMarkers(); |
| 935 } | 933 } |
| 936 | 934 |
| 937 void SpellChecker::SpellCheckAfterBlur() { | 935 void SpellChecker::SpellCheckAfterBlur() { |
| 938 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) | 936 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) |
| 939 return; | 937 return; |
| 940 | 938 |
| 941 // TODO(editing-dev): Hoist updateStyleAndLayoutIgnorePendingStylesheets | 939 // TODO(editing-dev): Hoist updateStyleAndLayoutIgnorePendingStylesheets |
| 942 // to caller. See http://crbug.com/590369 for more details. | 940 // to caller. See http://crbug.com/590369 for more details. |
| 943 // In the long term we should use idle time spell checker to | 941 // In the long term we should use idle time spell checker to |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 if (!input.IsFocusedElementInDocument()) | 1195 if (!input.IsFocusedElementInDocument()) |
| 1198 return false; | 1196 return false; |
| 1199 } | 1197 } |
| 1200 } | 1198 } |
| 1201 HTMLElement* element = | 1199 HTMLElement* element = |
| 1202 Traversal<HTMLElement>::FirstAncestorOrSelf(*position.AnchorNode()); | 1200 Traversal<HTMLElement>::FirstAncestorOrSelf(*position.AnchorNode()); |
| 1203 return element && element->IsSpellCheckingEnabled(); | 1201 return element && element->IsSpellCheckingEnabled(); |
| 1204 } | 1202 } |
| 1205 | 1203 |
| 1206 } // namespace blink | 1204 } // namespace blink |
| OLD | NEW |