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 18 matching lines...) Expand all Loading... |
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/frame/LocalFrame.h" | 32 #include "core/frame/LocalFrame.h" |
33 #include "core/page/Page.h" | 33 #include "core/page/Page.h" |
34 #include "public/web/WebSpellCheckClient.h" | 34 #include "public/web/WebSpellCheckClient.h" |
35 #include "web/WebViewImpl.h" | 35 #include "web/WebViewImpl.h" |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 SpellCheckerClientImpl::SpellCheckerClientImpl( | 39 SpellCheckerClientImpl::SpellCheckerClientImpl(WebViewImpl* webview) |
40 WebViewImpl* webview, | 40 : m_webView(webview), m_spellCheckThisFieldStatus(SpellCheckAutomatic) {} |
41 TextCheckerClient* textCheckerClient) | |
42 : m_webView(webview), | |
43 m_textCheckerClient(textCheckerClient), | |
44 m_spellCheckThisFieldStatus(SpellCheckAutomatic) {} | |
45 | 41 |
46 SpellCheckerClientImpl::~SpellCheckerClientImpl() {} | 42 SpellCheckerClientImpl::~SpellCheckerClientImpl() {} |
47 | 43 |
48 bool SpellCheckerClientImpl::shouldSpellcheckByDefault() { | 44 bool SpellCheckerClientImpl::shouldSpellcheckByDefault() { |
49 // Spellcheck should be enabled for all editable areas (such as textareas, | 45 // Spellcheck should be enabled for all editable areas (such as textareas, |
50 // contentEditable regions, designMode docs and inputs). | 46 // contentEditable regions, designMode docs and inputs). |
51 if (!m_webView->focusedCoreFrame()->isLocalFrame()) | 47 if (!m_webView->focusedCoreFrame()->isLocalFrame()) |
52 return false; | 48 return false; |
53 const LocalFrame* frame = toLocalFrame(m_webView->focusedCoreFrame()); | 49 const LocalFrame* frame = toLocalFrame(m_webView->focusedCoreFrame()); |
54 if (!frame) | 50 if (!frame) |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 m_webView->spellCheckClient()->showSpellingUI(show); | 118 m_webView->spellCheckClient()->showSpellingUI(show); |
123 } | 119 } |
124 | 120 |
125 bool SpellCheckerClientImpl::spellingUIIsShowing() { | 121 bool SpellCheckerClientImpl::spellingUIIsShowing() { |
126 if (m_webView->spellCheckClient()) | 122 if (m_webView->spellCheckClient()) |
127 return m_webView->spellCheckClient()->isShowingSpellingUI(); | 123 return m_webView->spellCheckClient()->isShowingSpellingUI(); |
128 return false; | 124 return false; |
129 } | 125 } |
130 | 126 |
131 } // namespace blink | 127 } // namespace blink |
OLD | NEW |