Chromium Code Reviews| 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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1071 } | 1071 } |
| 1072 | 1072 |
| 1073 DEFINE_TRACE(SpellChecker) { | 1073 DEFINE_TRACE(SpellChecker) { |
| 1074 visitor->Trace(frame_); | 1074 visitor->Trace(frame_); |
| 1075 visitor->Trace(spell_check_requester_); | 1075 visitor->Trace(spell_check_requester_); |
| 1076 visitor->Trace(idle_spell_check_callback_); | 1076 visitor->Trace(idle_spell_check_callback_); |
| 1077 } | 1077 } |
| 1078 | 1078 |
| 1079 void SpellChecker::PrepareForLeakDetection() { | 1079 void SpellChecker::PrepareForLeakDetection() { |
| 1080 spell_check_requester_->PrepareForLeakDetection(); | 1080 spell_check_requester_->PrepareForLeakDetection(); |
| 1081 idle_spell_check_callback_->Deactivate(); | |
|
Xiaocheng
2017/05/26 21:15:09
Please guard this line with
if (RuntimeEnabledFea
hiroshige
2017/05/26 21:40:03
Done.
| |
| 1081 } | 1082 } |
| 1082 | 1083 |
| 1083 Vector<TextCheckingResult> SpellChecker::FindMisspellings(const String& text) { | 1084 Vector<TextCheckingResult> SpellChecker::FindMisspellings(const String& text) { |
| 1084 Vector<UChar> characters; | 1085 Vector<UChar> characters; |
| 1085 text.AppendTo(characters); | 1086 text.AppendTo(characters); |
| 1086 unsigned length = text.length(); | 1087 unsigned length = text.length(); |
| 1087 | 1088 |
| 1088 TextBreakIterator* iterator = WordBreakIterator(characters.data(), length); | 1089 TextBreakIterator* iterator = WordBreakIterator(characters.data(), length); |
| 1089 if (!iterator) | 1090 if (!iterator) |
| 1090 return Vector<TextCheckingResult>(); | 1091 return Vector<TextCheckingResult>(); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1220 if (!input.IsFocusedElementInDocument()) | 1221 if (!input.IsFocusedElementInDocument()) |
| 1221 return false; | 1222 return false; |
| 1222 } | 1223 } |
| 1223 } | 1224 } |
| 1224 HTMLElement* element = | 1225 HTMLElement* element = |
| 1225 Traversal<HTMLElement>::FirstAncestorOrSelf(*position.AnchorNode()); | 1226 Traversal<HTMLElement>::FirstAncestorOrSelf(*position.AnchorNode()); |
| 1226 return element && element->IsSpellCheckingEnabled(); | 1227 return element && element->IsSpellCheckingEnabled(); |
| 1227 } | 1228 } |
| 1228 | 1229 |
| 1229 } // namespace blink | 1230 } // namespace blink |
| OLD | NEW |