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

Unified Diff: components/spellcheck/renderer/spellcheck_provider.cc

Issue 2712833004: Stop SpellCheckProvider from deciding typing progress (Closed)
Patch Set: Add comment about partial word Created 3 years, 10 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: components/spellcheck/renderer/spellcheck_provider.cc
diff --git a/components/spellcheck/renderer/spellcheck_provider.cc b/components/spellcheck/renderer/spellcheck_provider.cc
index 8e7758bfdc472c7642ddb8325107926e6849e685..2f9c7df8bc281f8f44dd98e5ae36585be7be07a1 100644
--- a/components/spellcheck/renderer/spellcheck_provider.cc
+++ b/components/spellcheck/renderer/spellcheck_provider.cc
@@ -300,6 +300,8 @@ bool SpellCheckProvider::SatisfyRequestFromCache(
const base::string16& text,
WebTextCheckingCompletion* completion) {
size_t last_length = last_request_.length();
+ if (!last_length)
+ return false;
// Send back the |last_results_| if the |last_request_| is a substring of
// |text| and |text| does not have more words to check. Provider cannot cancel
@@ -314,15 +316,8 @@ bool SpellCheckProvider::SatisfyRequestFromCache(
completion->didFinishCheckingText(last_results_);
return true;
}
- int code = 0;
- int length = static_cast<int>(text_length);
- U16_PREV(text.data(), 0, length, code);
- UErrorCode error = U_ZERO_ERROR;
- if (uscript_getScript(code, &error) != USCRIPT_COMMON) {
- completion->didCancelCheckingText();
- return true;
- }
}
+
// Create a subset of the cached results and return it if the given text is a
// substring of the cached text.
if (text_length < last_length &&

Powered by Google App Engine
This is Rietveld 408576698