mirror of
https://github.com/electron/electron.git
synced 2026-01-06 22:24:03 -05:00
7126479: add ShouldForceRefreshTextCheckService parameter to SpellCheckClient
Upstream added a force-refresh parameter to WebTextCheckClient::RequestCheckingOfText to bypass spell check cache. Add the new ShouldForceRefreshTextCheckService parameter to SpellCheckClient's override (currently unused in Electron). Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7126479
This commit is contained in:
@@ -90,12 +90,13 @@ SpellCheckClient::~SpellCheckClient() {
|
||||
}
|
||||
|
||||
void SpellCheckClient::RequestCheckingOfText(
|
||||
const blink::WebString& textToCheck,
|
||||
std::unique_ptr<blink::WebTextCheckingCompletion> completionCallback) {
|
||||
std::u16string text(textToCheck.Utf16());
|
||||
const blink::WebString& text_to_check,
|
||||
ShouldForceRefreshTextCheckService /* should_force_refresh */,
|
||||
std::unique_ptr<blink::WebTextCheckingCompletion> completion_callback) {
|
||||
std::u16string text(text_to_check.Utf16());
|
||||
// Ignore invalid requests.
|
||||
if (text.empty() || !HasWordCharacters(text, 0)) {
|
||||
completionCallback->DidCancelCheckingText();
|
||||
completion_callback->DidCancelCheckingText();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -105,7 +106,7 @@ void SpellCheckClient::RequestCheckingOfText(
|
||||
}
|
||||
|
||||
pending_request_param_ =
|
||||
std::make_unique<SpellcheckRequest>(text, std::move(completionCallback));
|
||||
std::make_unique<SpellcheckRequest>(text, std::move(completion_callback));
|
||||
|
||||
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
|
||||
FROM_HERE, base::BindOnce(&SpellCheckClient::SpellCheckText,
|
||||
|
||||
@@ -41,9 +41,11 @@ class SpellCheckClient : public blink::WebSpellCheckPanelHostClient,
|
||||
private:
|
||||
class SpellcheckRequest;
|
||||
// blink::WebTextCheckClient:
|
||||
void RequestCheckingOfText(const blink::WebString& textToCheck,
|
||||
std::unique_ptr<blink::WebTextCheckingCompletion>
|
||||
completionCallback) override;
|
||||
void RequestCheckingOfText(
|
||||
const blink::WebString& text_to_check,
|
||||
ShouldForceRefreshTextCheckService should_force_refresh,
|
||||
std::unique_ptr<blink::WebTextCheckingCompletion> completion_callback)
|
||||
override;
|
||||
bool IsSpellCheckingEnabled() const override;
|
||||
|
||||
// blink::WebSpellCheckPanelHostClient:
|
||||
|
||||
Reference in New Issue
Block a user