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 20 matching lines...) Expand all Loading... |
31 #include "core/editing/Editor.h" | 31 #include "core/editing/Editor.h" |
32 #include "core/editing/SpellChecker.h" | 32 #include "core/editing/SpellChecker.h" |
33 #include "core/frame/LocalFrame.h" | 33 #include "core/frame/LocalFrame.h" |
34 #include "core/frame/Settings.h" | 34 #include "core/frame/Settings.h" |
35 #include "core/page/Page.h" | 35 #include "core/page/Page.h" |
36 #include "public/web/WebSpellCheckClient.h" | 36 #include "public/web/WebSpellCheckClient.h" |
37 #include "public/web/WebTextCheckingResult.h" | 37 #include "public/web/WebTextCheckingResult.h" |
38 #include "web/WebTextCheckingCompletionImpl.h" | 38 #include "web/WebTextCheckingCompletionImpl.h" |
39 #include "web/WebViewImpl.h" | 39 #include "web/WebViewImpl.h" |
40 | 40 |
41 using namespace blink; | |
42 | |
43 namespace blink { | 41 namespace blink { |
44 | 42 |
45 SpellCheckerClientImpl::SpellCheckerClientImpl(WebViewImpl* webview) | 43 SpellCheckerClientImpl::SpellCheckerClientImpl(WebViewImpl* webview) |
46 : m_webView(webview) | 44 : m_webView(webview) |
47 , m_spellCheckThisFieldStatus(SpellCheckAutomatic) | 45 , m_spellCheckThisFieldStatus(SpellCheckAutomatic) |
48 { | 46 { |
49 } | 47 } |
50 | 48 |
51 SpellCheckerClientImpl::~SpellCheckerClientImpl() | 49 SpellCheckerClientImpl::~SpellCheckerClientImpl() |
52 { | 50 { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 142 } |
145 | 143 |
146 // Note: the Mac code checks if the pointers are null before writing to them
, | 144 // Note: the Mac code checks if the pointers are null before writing to them
, |
147 // so we do too. | 145 // so we do too. |
148 if (misspellingLocation) | 146 if (misspellingLocation) |
149 *misspellingLocation = spellLocation; | 147 *misspellingLocation = spellLocation; |
150 if (misspellingLength) | 148 if (misspellingLength) |
151 *misspellingLength = spellLength; | 149 *misspellingLength = spellLength; |
152 } | 150 } |
153 | 151 |
154 void SpellCheckerClientImpl::requestCheckingOfString(WTF::PassRefPtr<blink::Text
CheckingRequest> request) | 152 void SpellCheckerClientImpl::requestCheckingOfString(WTF::PassRefPtr<TextCheckin
gRequest> request) |
155 { | 153 { |
156 if (m_webView->spellCheckClient()) { | 154 if (m_webView->spellCheckClient()) { |
157 const String& text = request->data().text(); | 155 const String& text = request->data().text(); |
158 const Vector<uint32_t>& markers = request->data().markers(); | 156 const Vector<uint32_t>& markers = request->data().markers(); |
159 const Vector<unsigned>& markerOffsets = request->data().offsets(); | 157 const Vector<unsigned>& markerOffsets = request->data().offsets(); |
160 m_webView->spellCheckClient()->requestCheckingOfText(text, markers, mark
erOffsets, new WebTextCheckingCompletionImpl(request)); | 158 m_webView->spellCheckClient()->requestCheckingOfText(text, markers, mark
erOffsets, new WebTextCheckingCompletionImpl(request)); |
161 } | 159 } |
162 } | 160 } |
163 | 161 |
164 String SpellCheckerClientImpl::getAutoCorrectSuggestionForMisspelledWord(const S
tring& misspelledWord) | 162 String SpellCheckerClientImpl::getAutoCorrectSuggestionForMisspelledWord(const S
tring& misspelledWord) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 m_webView->spellCheckClient()->showSpellingUI(show); | 223 m_webView->spellCheckClient()->showSpellingUI(show); |
226 } | 224 } |
227 | 225 |
228 bool SpellCheckerClientImpl::spellingUIIsShowing() | 226 bool SpellCheckerClientImpl::spellingUIIsShowing() |
229 { | 227 { |
230 if (m_webView->spellCheckClient()) | 228 if (m_webView->spellCheckClient()) |
231 return m_webView->spellCheckClient()->isShowingSpellingUI(); | 229 return m_webView->spellCheckClient()->isShowingSpellingUI(); |
232 return false; | 230 return false; |
233 } | 231 } |
234 | 232 |
235 } // namesace WebKit | 233 } // namespace blink |
OLD | NEW |