| 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 11 matching lines...) Expand all Loading... |
| 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "web/SpellCheckerClientImpl.h" | 27 #include "web/SpellCheckerClientImpl.h" |
| 28 | 28 |
| 29 #include "core/dom/Element.h" | 29 #include "core/dom/Element.h" |
| 30 #include "core/editing/markers/DocumentMarkerController.h" | 30 #include "core/editing/markers/DocumentMarkerController.h" |
| 31 #include "core/editing/spellcheck/SpellChecker.h" | 31 #include "core/editing/spellcheck/SpellChecker.h" |
| 32 #include "core/exported/WebViewBase.h" |
| 32 #include "core/frame/LocalFrame.h" | 33 #include "core/frame/LocalFrame.h" |
| 33 #include "core/page/Page.h" | 34 #include "core/page/Page.h" |
| 34 #include "public/web/WebSpellCheckClient.h" | 35 #include "public/web/WebSpellCheckClient.h" |
| 35 #include "web/WebViewImpl.h" | |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 SpellCheckerClientImpl::SpellCheckerClientImpl(WebViewImpl* webview) | 39 SpellCheckerClientImpl::SpellCheckerClientImpl(WebViewBase* webview) |
| 40 : web_view_(webview), | 40 : web_view_(webview), |
| 41 spell_check_this_field_status_(kSpellCheckAutomatic) {} | 41 spell_check_this_field_status_(kSpellCheckAutomatic) {} |
| 42 | 42 |
| 43 SpellCheckerClientImpl::~SpellCheckerClientImpl() {} | 43 SpellCheckerClientImpl::~SpellCheckerClientImpl() {} |
| 44 | 44 |
| 45 bool SpellCheckerClientImpl::ShouldSpellcheckByDefault() { | 45 bool SpellCheckerClientImpl::ShouldSpellcheckByDefault() { |
| 46 // Spellcheck should be enabled for all editable areas (such as textareas, | 46 // Spellcheck should be enabled for all editable areas (such as textareas, |
| 47 // contentEditable regions, designMode docs and inputs). | 47 // contentEditable regions, designMode docs and inputs). |
| 48 if (!web_view_->FocusedCoreFrame()->IsLocalFrame()) | 48 if (!web_view_->FocusedCoreFrame()->IsLocalFrame()) |
| 49 return false; | 49 return false; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 web_view_->SpellCheckClient()->ShowSpellingUI(show); | 119 web_view_->SpellCheckClient()->ShowSpellingUI(show); |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool SpellCheckerClientImpl::SpellingUIIsShowing() { | 122 bool SpellCheckerClientImpl::SpellingUIIsShowing() { |
| 123 if (web_view_->SpellCheckClient()) | 123 if (web_view_->SpellCheckClient()) |
| 124 return web_view_->SpellCheckClient()->IsShowingSpellingUI(); | 124 return web_view_->SpellCheckClient()->IsShowingSpellingUI(); |
| 125 return false; | 125 return false; |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace blink | 128 } // namespace blink |
| OLD | NEW |