spellcheck_features.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_SPELLCHECK_COMMON_SPELLCHECK_FEATURES_H_
  5. #define COMPONENTS_SPELLCHECK_COMMON_SPELLCHECK_FEATURES_H_
  6. #include "base/feature_list.h"
  7. #include "build/build_config.h"
  8. #include "components/spellcheck/spellcheck_buildflags.h"
  9. namespace spellcheck {
  10. #if BUILDFLAG(ENABLE_SPELLCHECK)
  11. bool UseBrowserSpellChecker();
  12. #if BUILDFLAG(IS_WIN)
  13. extern const base::Feature kWinUseBrowserSpellChecker;
  14. // If the kWinDelaySpellcheckServiceInit feature flag is enabled, don't
  15. // initialize the spellcheck dictionaries when the SpellcheckService is
  16. // instantiated. With this flag set: (1) Completing the initialization of the
  17. // spellcheck service is on-demand, invoked by calling
  18. // SpellcheckService::InitializeDictionaries with a callback to indicate when
  19. // the operation completes. (2) The call to create the spellcheck service in
  20. // ChromeBrowserMainParts::PreMainMessageLoopRunImpl will be skipped. Chromium
  21. // will still by default instantiate the spellcheck service on startup for
  22. // custom dictionary synchronization, but will not load Windows spellcheck
  23. // dictionaries. The command line for launching the browser with Windows hybrid
  24. // spellchecking enabled but no initialization of the spellcheck service is:
  25. // chrome
  26. // --enable-features=WinUseBrowserSpellChecker,WinDelaySpellcheckServiceInit
  27. // and if instantiation of the spellcheck service needs to be completely
  28. // disabled:
  29. // chrome
  30. // --enable-features=WinUseBrowserSpellChecker,WinDelaySpellcheckServiceInit
  31. // --disable-sync-types="Dictionary"
  32. extern const base::Feature kWinDelaySpellcheckServiceInit;
  33. // When set, do not perform the expensive operation of retrieving suggestions
  34. // for all misspelled words while performing a text check. Instead retrieve
  35. // suggestions on demand when the context menu is brought up with a misspelled
  36. // word selected.
  37. extern const base::Feature kWinRetrieveSuggestionsOnlyOnDemand;
  38. bool WindowsVersionSupportsSpellchecker();
  39. #endif // BUILDFLAG(IS_WIN)
  40. #if BUILDFLAG(IS_ANDROID)
  41. bool IsAndroidSpellCheckFeatureEnabled();
  42. #endif // BUILDFLAG(IS_ANDROID)
  43. #endif // BUILDFLAG(ENABLE_SPELLCHECK)
  44. } // namespace spellcheck
  45. #endif // COMPONENTS_SPELLCHECK_COMMON_SPELLCHECK_FEATURES_H_