| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google, Inc. All rights reserved. | 3 * Copyright (C) 2012 Google, Inc. All rights reserved. |
| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 return true; | 136 return true; |
| 137 return shouldSpellcheckByDefault(); | 137 return shouldSpellcheckByDefault(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void EditorClientImpl::toggleContinuousSpellChecking() | 140 void EditorClientImpl::toggleContinuousSpellChecking() |
| 141 { | 141 { |
| 142 if (isContinuousSpellCheckingEnabled()) { | 142 if (isContinuousSpellCheckingEnabled()) { |
| 143 m_spellCheckThisFieldStatus = SpellCheckForcedOff; | 143 m_spellCheckThisFieldStatus = SpellCheckForcedOff; |
| 144 if (Page* page = m_webView->page()) { | 144 if (Page* page = m_webView->page()) { |
| 145 for (Frame* frame = page->mainFrame(); frame && frame->document(); f
rame = frame->tree()->traverseNext()) { | 145 for (Frame* frame = page->mainFrame(); frame && frame->document(); f
rame = frame->tree()->traverseNext()) { |
| 146 frame->document()->markers()->removeMarkers(DocumentMarker::Spel
ling | DocumentMarker::Grammar); | 146 frame->document()->markers()->removeMarkers(DocumentMarker::Miss
pellingMarkers()); |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 } else { | 149 } else { |
| 150 m_spellCheckThisFieldStatus = SpellCheckForcedOn; | 150 m_spellCheckThisFieldStatus = SpellCheckForcedOn; |
| 151 if (Frame* frame = m_webView->focusedWebCoreFrame()) { | 151 if (Frame* frame = m_webView->focusedWebCoreFrame()) { |
| 152 VisibleSelection frameSelection = frame->selection().selection(); | 152 VisibleSelection frameSelection = frame->selection().selection(); |
| 153 // If a selection is in an editable element spell check its content. | 153 // If a selection is in an editable element spell check its content. |
| 154 if (Element* rootEditableElement = frameSelection.rootEditableElemen
t()) { | 154 if (Element* rootEditableElement = frameSelection.rootEditableElemen
t()) { |
| 155 frame->editor().elementDidBeginEditing(rootEditableElement); | 155 frame->editor().elementDidBeginEditing(rootEditableElement); |
| 156 } | 156 } |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 #endif | 777 #endif |
| 778 } | 778 } |
| 779 | 779 |
| 780 void EditorClientImpl::willSetInputMethodState() | 780 void EditorClientImpl::willSetInputMethodState() |
| 781 { | 781 { |
| 782 if (m_webView->client()) | 782 if (m_webView->client()) |
| 783 m_webView->client()->resetInputMethod(); | 783 m_webView->client()->resetInputMethod(); |
| 784 } | 784 } |
| 785 | 785 |
| 786 } // namesace WebKit | 786 } // namesace WebKit |
| OLD | NEW |