Skip to content

Commit

Permalink
build: fix build with enable_builtin_spellchecker=false (#26466)
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak committed Nov 14, 2020
1 parent e017d87 commit 434f774
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions shell/renderer/api/electron_api_web_frame.cc
Expand Up @@ -106,6 +106,8 @@ content::RenderFrame* GetRenderFrame(v8::Local<v8::Value> value) {
return content::RenderFrame::FromWebFrame(frame);
}

#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)

bool SpellCheckWord(v8::Isolate* isolate,
v8::Local<v8::Value> window,
const std::string& word,
Expand All @@ -124,6 +126,8 @@ bool SpellCheckWord(v8::Isolate* isolate,
w.c_str(), 0, word.size(), id, &start, &length, optional_suggestions);
}

#endif

class RenderFrameStatus final : public content::RenderFrameObserver {
public:
explicit RenderFrameStatus(content::RenderFrame* render_frame)
Expand Down Expand Up @@ -753,6 +757,8 @@ blink::WebCacheResourceTypeStats GetResourceUsage(v8::Isolate* isolate) {
return stats;
}

#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)

bool IsWordMisspelled(v8::Isolate* isolate,
v8::Local<v8::Value> window,
const std::string& word) {
Expand All @@ -767,6 +773,8 @@ std::vector<base::string16> GetWordSuggestions(v8::Isolate* isolate,
return suggestions;
}

#endif

void ClearCache(v8::Isolate* isolate) {
isolate->IdleNotificationDeadline(0.5);
blink::WebCache::Clear();
Expand Down

0 comments on commit 434f774

Please sign in to comment.