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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 if (m_spellCheckThisFieldStatus == SpellCheckForcedOn) | 132 if (m_spellCheckThisFieldStatus == SpellCheckForcedOn) |
133 return true; | 133 return true; |
134 return shouldSpellcheckByDefault(); | 134 return shouldSpellcheckByDefault(); |
135 } | 135 } |
136 | 136 |
137 void EditorClientImpl::toggleContinuousSpellChecking() | 137 void EditorClientImpl::toggleContinuousSpellChecking() |
138 { | 138 { |
139 if (isContinuousSpellCheckingEnabled()) { | 139 if (isContinuousSpellCheckingEnabled()) { |
140 m_spellCheckThisFieldStatus = SpellCheckForcedOff; | 140 m_spellCheckThisFieldStatus = SpellCheckForcedOff; |
141 if (Page* page = m_webView->page()) { | 141 if (Page* page = m_webView->page()) { |
142 for (Frame* frame = page->mainFrame(); frame && frame->document(); f
rame = frame->tree()->traverseNext()) { | 142 for (Frame* frame = page->mainFrame(); frame && frame->document(); f
rame = frame->tree().traverseNext()) { |
143 frame->document()->markers()->removeMarkers(DocumentMarker::Miss
pellingMarkers()); | 143 frame->document()->markers()->removeMarkers(DocumentMarker::Miss
pellingMarkers()); |
144 } | 144 } |
145 } | 145 } |
146 } else { | 146 } else { |
147 m_spellCheckThisFieldStatus = SpellCheckForcedOn; | 147 m_spellCheckThisFieldStatus = SpellCheckForcedOn; |
148 if (Frame* frame = m_webView->focusedWebCoreFrame()) { | 148 if (Frame* frame = m_webView->focusedWebCoreFrame()) { |
149 VisibleSelection frameSelection = frame->selection().selection(); | 149 VisibleSelection frameSelection = frame->selection().selection(); |
150 // If a selection is in an editable element spell check its content. | 150 // If a selection is in an editable element spell check its content. |
151 if (Element* rootEditableElement = frameSelection.rootEditableElemen
t()) { | 151 if (Element* rootEditableElement = frameSelection.rootEditableElemen
t()) { |
152 frame->editor().didBeginEditing(rootEditableElement); | 152 frame->editor().didBeginEditing(rootEditableElement); |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 #endif | 693 #endif |
694 } | 694 } |
695 | 695 |
696 void EditorClientImpl::willSetInputMethodState() | 696 void EditorClientImpl::willSetInputMethodState() |
697 { | 697 { |
698 if (m_webView->client()) | 698 if (m_webView->client()) |
699 m_webView->client()->resetInputMethod(); | 699 m_webView->client()->resetInputMethod(); |
700 } | 700 } |
701 | 701 |
702 } // namesace WebKit | 702 } // namesace WebKit |
OLD | NEW |