build: fix build without built-in spellchecker (#22594)
This commit is contained in:
parent
3ff98e15d0
commit
bf75e5a91f
5 changed files with 30 additions and 7 deletions
|
@ -9,7 +9,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "base/values.h"
|
||||
#include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h"
|
||||
#include "content/public/browser/download_manager.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "gin/handle.h"
|
||||
|
@ -17,6 +16,10 @@
|
|||
#include "shell/common/gin_helper/promise.h"
|
||||
#include "shell/common/gin_helper/trackable_object.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
|
||||
#include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" // nogncheck
|
||||
#endif
|
||||
|
||||
class GURL;
|
||||
|
||||
namespace base {
|
||||
|
@ -38,8 +41,10 @@ class ElectronBrowserContext;
|
|||
namespace api {
|
||||
|
||||
class Session : public gin_helper::TrackableObject<Session>,
|
||||
public content::DownloadManager::Observer,
|
||||
public SpellcheckHunspellDictionary::Observer {
|
||||
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
|
||||
public SpellcheckHunspellDictionary::Observer,
|
||||
#endif
|
||||
public content::DownloadManager::Observer {
|
||||
public:
|
||||
// Gets or creates Session from the |browser_context|.
|
||||
static gin::Handle<Session> CreateFrom(
|
||||
|
@ -118,6 +123,7 @@ class Session : public gin_helper::TrackableObject<Session>,
|
|||
void OnDownloadCreated(content::DownloadManager* manager,
|
||||
download::DownloadItem* item) override;
|
||||
|
||||
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
|
||||
// SpellcheckHunspellDictionary::Observer
|
||||
void OnHunspellDictionaryInitialized(const std::string& language) override;
|
||||
void OnHunspellDictionaryDownloadBegin(const std::string& language) override;
|
||||
|
@ -125,6 +131,7 @@ class Session : public gin_helper::TrackableObject<Session>,
|
|||
const std::string& language) override;
|
||||
void OnHunspellDictionaryDownloadFailure(
|
||||
const std::string& language) override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
// Cached gin_helper::Wrappable objects.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue