| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // cause any problems to the LocalFrame's behavior. | 73 // cause any problems to the LocalFrame's behavior. |
| 74 if (!element) | 74 if (!element) |
| 75 return true; | 75 return true; |
| 76 const LayoutObject* layoutObject = element->layoutObject(); | 76 const LayoutObject* layoutObject = element->layoutObject(); |
| 77 if (!layoutObject) | 77 if (!layoutObject) |
| 78 return false; | 78 return false; |
| 79 | 79 |
| 80 return true; | 80 return true; |
| 81 } | 81 } |
| 82 | 82 |
| 83 bool SpellCheckerClientImpl::isContinuousSpellCheckingEnabled() | 83 bool SpellCheckerClientImpl::isSpellCheckingEnabled() |
| 84 { | 84 { |
| 85 if (m_spellCheckThisFieldStatus == SpellCheckForcedOff) | 85 if (m_spellCheckThisFieldStatus == SpellCheckForcedOff) |
| 86 return false; | 86 return false; |
| 87 if (m_spellCheckThisFieldStatus == SpellCheckForcedOn) | 87 if (m_spellCheckThisFieldStatus == SpellCheckForcedOn) |
| 88 return true; | 88 return true; |
| 89 return shouldSpellcheckByDefault(); | 89 return shouldSpellcheckByDefault(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void SpellCheckerClientImpl::toggleContinuousSpellChecking() | 92 void SpellCheckerClientImpl::toggleSpellCheckingEnabled() |
| 93 { | 93 { |
| 94 if (isContinuousSpellCheckingEnabled()) { | 94 if (isSpellCheckingEnabled()) { |
| 95 m_spellCheckThisFieldStatus = SpellCheckForcedOff; | 95 m_spellCheckThisFieldStatus = SpellCheckForcedOff; |
| 96 if (Page* page = m_webView->page()) { | 96 if (Page* page = m_webView->page()) { |
| 97 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().
traverseNext()) { | 97 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().
traverseNext()) { |
| 98 if (!frame->isLocalFrame()) | 98 if (!frame->isLocalFrame()) |
| 99 continue; | 99 continue; |
| 100 toLocalFrame(frame)->document()->markers().removeMarkers(Documen
tMarker::MisspellingMarkers()); | 100 toLocalFrame(frame)->document()->markers().removeMarkers(Documen
tMarker::MisspellingMarkers()); |
| 101 } | 101 } |
| 102 } | 102 } |
| 103 } else { | 103 } else { |
| 104 m_spellCheckThisFieldStatus = SpellCheckForcedOn; | 104 m_spellCheckThisFieldStatus = SpellCheckForcedOn; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 167 } |
| 168 | 168 |
| 169 bool SpellCheckerClientImpl::spellingUIIsShowing() | 169 bool SpellCheckerClientImpl::spellingUIIsShowing() |
| 170 { | 170 { |
| 171 if (m_webView->spellCheckClient()) | 171 if (m_webView->spellCheckClient()) |
| 172 return m_webView->spellCheckClient()->isShowingSpellingUI(); | 172 return m_webView->spellCheckClient()->isShowingSpellingUI(); |
| 173 return false; | 173 return false; |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace blink | 176 } // namespace blink |
| OLD | NEW |