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

Unified Diff: content/shell/renderer/test_runner/SpellCheckClient.cpp

Issue 410283003: test_runner: Migrate MockSpellCheck to Chromium C++ style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Build.gn Created 6 years, 5 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: content/shell/renderer/test_runner/SpellCheckClient.cpp
diff --git a/content/shell/renderer/test_runner/SpellCheckClient.cpp b/content/shell/renderer/test_runner/SpellCheckClient.cpp
index e4c1e650179c3f874f7aebb8471e83e7a6741a63..94b09ae0e2abaee5cda393a3e0cb0abc0e9a3149 100644
--- a/content/shell/renderer/test_runner/SpellCheckClient.cpp
+++ b/content/shell/renderer/test_runner/SpellCheckClient.cpp
@@ -51,7 +51,7 @@ void SpellCheckClient::setDelegate(WebTestDelegate* delegate)
void SpellCheckClient::spellCheck(const WebString& text, int& misspelledOffset, int& misspelledLength, WebVector<WebString>* optionalSuggestions)
{
// Check the spelling of the given text.
- m_spellcheck.spellCheckWord(text, &misspelledOffset, &misspelledLength);
+ m_spellcheck.SpellCheckWord(text, &misspelledOffset, &misspelledLength);
}
void SpellCheckClient::checkTextOfParagraph(const WebString& text, WebTextCheckingTypeMask mask, WebVector<WebTextCheckingResult>* webResults)
@@ -63,7 +63,8 @@ void SpellCheckClient::checkTextOfParagraph(const WebString& text, WebTextChecki
while (offset < data.length()) {
int misspelledPosition = 0;
int misspelledLength = 0;
- m_spellcheck.spellCheckWord(data.substr(offset), &misspelledPosition, &misspelledLength);
+ m_spellcheck.SpellCheckWord(
+ data.substr(offset), &misspelledPosition, &misspelledLength);
if (!misspelledLength)
break;
WebTextCheckingResult result;
@@ -96,7 +97,7 @@ void SpellCheckClient::requestCheckingOfText(
m_lastRequestedTextCheckingCompletion = completion;
m_lastRequestedTextCheckString = text;
- if (m_spellcheck.hasInCache(text))
+ if (m_spellcheck.HasInCache(text))
finishLastTextCheck();
else
m_delegate->postDelayedTask(new HostMethodTask(this, &SpellCheckClient::finishLastTextCheck), 0);
@@ -109,15 +110,18 @@ void SpellCheckClient::finishLastTextCheck()
std::vector<WebTextCheckingResult> results;
int offset = 0;
base::string16 text = m_lastRequestedTextCheckString;
- if (!m_spellcheck.isMultiWordMisspelling(WebString(text), &results)) {
+ if (!m_spellcheck.IsMultiWordMisspelling(WebString(text), &results)) {
while (text.length()) {
int misspelledPosition = 0;
int misspelledLength = 0;
- m_spellcheck.spellCheckWord(WebString(text), &misspelledPosition, &misspelledLength);
+ m_spellcheck.SpellCheckWord(
+ WebString(text), &misspelledPosition, &misspelledLength);
if (!misspelledLength)
break;
WebVector<WebString> suggestions;
- m_spellcheck.fillSuggestionList(WebString(text.substr(misspelledPosition, misspelledLength)), &suggestions);
+ m_spellcheck.FillSuggestionList(
+ WebString(text.substr(misspelledPosition, misspelledLength)),
+ &suggestions);
results.push_back(WebTextCheckingResult(WebTextDecorationTypeSpelling, offset + misspelledPosition, misspelledLength, suggestions.isEmpty() ? WebString() : suggestions[0]));
text = text.substr(misspelledPosition + misspelledLength);
offset += misspelledPosition + misspelledLength;
« no previous file with comments | « content/shell/renderer/test_runner/SpellCheckClient.h ('k') | content/shell/renderer/test_runner/event_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698