WebTextCheckClient* Document::GetWebTextCheckClient() const {How about making this a free function and moving it to spell_check_custom_dictionary.cc ?
The directory name should be `modules/spell_check_custom_dictionary/`.
custom_words.push_back(phrase.Ascii());Why do we apply `Ascii()`?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
WebTextCheckClient* Document::GetWebTextCheckClient() const {How about making this a free function and moving it to spell_check_custom_dictionary.cc ?
Done
The directory name should be `modules/spell_check_custom_dictionary/`.
Done
Why do we apply `Ascii()`?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
#include "third_party/blink/public/web/web_text_check_client.h"This change looks unnecessary.
auto* execution_context = ExecutionContext::From(script_state);
if (execution_context->IsWindow()) {
Document* document = To<LocalDOMWindow>(execution_context)->document();
if (document->GetFrame()) {
WebTextCheckClient* client =
document->GetFrame()->Client()->GetTextCheckerClient();
if (client && client->IsSpellCheckingEnabled()) {
std::vector<std::string> custom_words;Adding a function for this part would make these functions cleaner.
```cpp
namespace {
WebTextCheckCLient* GetTextCheckClient(ScriptState* scirpt_state) {
auto* execution_context = ExecutionContext::From(script_state);
if (execution_context->IsWindow()) {
Document* document = To<LocalDOMWindow>(execution_context)->document();
if (document->GetFrame()) {
WebTextCheckClient* client =
document->GetFrame()->Client()->GetTextCheckerClient();
if (client && client->IsSpellCheckingEnabled()) {
return client;
}
}
}
return nullptr;
}
}
...
if (auto* client = GetTextCheckClient(script_state)) {
std::vector<std::string> cutom_words;
```
] partial interface Window { Please fix this WARNING reported by Trailing Whitespace: Please remove the trailing whitespace.
Please remove the trailing whitespace.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
#include "third_party/blink/public/web/web_text_check_client.h"Ziran SunThis change looks unnecessary.
Done
auto* execution_context = ExecutionContext::From(script_state);
if (execution_context->IsWindow()) {
Document* document = To<LocalDOMWindow>(execution_context)->document();
if (document->GetFrame()) {
WebTextCheckClient* client =
document->GetFrame()->Client()->GetTextCheckerClient();
if (client && client->IsSpellCheckingEnabled()) {
std::vector<std::string> custom_words;Adding a function for this part would make these functions cleaner.
```cpp
namespace {
WebTextCheckCLient* GetTextCheckClient(ScriptState* scirpt_state) {
auto* execution_context = ExecutionContext::From(script_state);
if (execution_context->IsWindow()) {
Document* document = To<LocalDOMWindow>(execution_context)->document();
if (document->GetFrame()) {
WebTextCheckClient* client =
document->GetFrame()->Client()->GetTextCheckerClient();
if (client && client->IsSpellCheckingEnabled()) {
return client;
}
}
}
return nullptr;
}
}...
if (auto* client = GetTextCheckClient(script_state)) {
std::vector<std::string> cutom_words;
```
Done
Please fix this WARNING reported by Trailing Whitespace: Please remove the trailing whitespace.
Please remove the trailing whitespace.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |