Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(914)

Unified Diff: third_party/WebKit/Source/web/SpellCheckerClientImpl.cpp

Issue 2796473002: Split TextCheckerClientImpl off SpellCheckerClientImpl (Closed)
Patch Set: Remove explicit Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/SpellCheckerClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/SpellCheckerClientImpl.cpp b/third_party/WebKit/Source/web/SpellCheckerClientImpl.cpp
index 0dced1021986433358baf4f3622dc4e7a8429524..d9fc25b76a0e43b3d7aa009d484972ca8c93de2f 100644
--- a/third_party/WebKit/Source/web/SpellCheckerClientImpl.cpp
+++ b/third_party/WebKit/Source/web/SpellCheckerClientImpl.cpp
@@ -30,17 +30,18 @@
#include "core/editing/markers/DocumentMarkerController.h"
#include "core/editing/spellcheck/SpellChecker.h"
#include "core/frame/LocalFrame.h"
-#include "core/frame/Settings.h"
#include "core/page/Page.h"
#include "public/web/WebSpellCheckClient.h"
-#include "public/web/WebTextCheckingResult.h"
-#include "web/WebTextCheckingCompletionImpl.h"
#include "web/WebViewImpl.h"
namespace blink {
-SpellCheckerClientImpl::SpellCheckerClientImpl(WebViewImpl* webview)
- : m_webView(webview), m_spellCheckThisFieldStatus(SpellCheckAutomatic) {}
+SpellCheckerClientImpl::SpellCheckerClientImpl(
+ WebViewImpl* webview,
+ TextCheckerClient* textCheckerClient)
+ : m_webView(webview),
+ m_textCheckerClient(textCheckerClient),
+ m_spellCheckThisFieldStatus(SpellCheckAutomatic) {}
SpellCheckerClientImpl::~SpellCheckerClientImpl() {}
@@ -109,46 +110,6 @@ void SpellCheckerClientImpl::toggleSpellCheckingEnabled() {
}
}
-void SpellCheckerClientImpl::checkSpellingOfString(const String& text,
- int* misspellingLocation,
- int* misspellingLength) {
- // SpellCheckWord will write (0, 0) into the output vars, which is what our
- // caller expects if the word is spelled correctly.
- int spellLocation = -1;
- int spellLength = 0;
-
- // Check to see if the provided text is spelled correctly.
- if (m_webView->spellCheckClient()) {
- m_webView->spellCheckClient()->checkSpelling(text, spellLocation,
- spellLength, nullptr);
- } else {
- spellLocation = 0;
- spellLength = 0;
- }
-
- // Note: the Mac code checks if the pointers are null before writing to them,
- // so we do too.
- if (misspellingLocation)
- *misspellingLocation = spellLocation;
- if (misspellingLength)
- *misspellingLength = spellLength;
-}
-
-void SpellCheckerClientImpl::requestCheckingOfString(
- TextCheckingRequest* request) {
- if (!m_webView->spellCheckClient())
- return;
- const String& text = request->data().text();
- m_webView->spellCheckClient()->requestCheckingOfText(
- text, new WebTextCheckingCompletionImpl(request));
-}
-
-void SpellCheckerClientImpl::cancelAllPendingRequests() {
- if (!m_webView->spellCheckClient())
- return;
- m_webView->spellCheckClient()->cancelAllPendingRequests();
-}
-
void SpellCheckerClientImpl::updateSpellingUIWithMisspelledWord(
const String& misspelledWord) {
if (m_webView->spellCheckClient())
« no previous file with comments | « third_party/WebKit/Source/web/SpellCheckerClientImpl.h ('k') | third_party/WebKit/Source/web/TextCheckerClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698