diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 15:09:05 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 15:09:05 +0000 |
commit | 9b75b5b69a63c9a7167badc5ca33e9910d4e390a (patch) | |
tree | f4336ee158e22d709c07ba92d0e10f2ae6922836 /chrome/browser/spellchecker.h | |
parent | de9904623b5b91688a98ee987ee6ccfe2f584085 (diff) | |
download | chromium_src-9b75b5b69a63c9a7167badc5ca33e9910d4e390a.zip chromium_src-9b75b5b69a63c9a7167badc5ca33e9910d4e390a.tar.gz chromium_src-9b75b5b69a63c9a7167badc5ca33e9910d4e390a.tar.bz2 |
Enable support for the Mac OS X spellchecking service in chromium.
spellchecker_platform_engine.h provides a basic interface for
platform specific spellcheckers to follow. spellchecker_mac.mm
implements these functions for the OS X spellchecking service.
spellchecker_win.cc and spellchecker_linux.cc provide a space for
future developments on these platforms. spellchecker_common.h
contains a few shared variables and typedefs that are useful across
all spellchecking code. spellchecker.cc has been modified to
call the SpellCheckerPlatform::SpellCheckerAvailable() and use
either hunspell or the platform spellchecker based on that
call. Many new test cases have been added to one of
the unit tests as well. chrome.gyp has been edited
to reflect the added files.
patch from pwicks86@gmail.com (paul wicks)
BUG=13206
TEST=spellchecking works in web pages
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19585 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/spellchecker.h')
-rw-r--r-- | chrome/browser/spellchecker.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/chrome/browser/spellchecker.h b/chrome/browser/spellchecker.h index a9c2946..40ba3f3 100644 --- a/chrome/browser/spellchecker.h +++ b/chrome/browser/spellchecker.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,6 +6,7 @@ #define CHROME_BROWSER_SPELLCHECKER_H_ #include <vector> +#include <string> #include "app/l10n_util.h" #include "base/string_util.h" @@ -112,6 +113,16 @@ class SpellChecker : public base::RefCountedThreadSafe<SpellChecker> { static Language GetLanguageFromLanguageRegion(Language input_language); private: + + // When called, relays the request to check the spelling to the proper + // backend, either hunspell or a platform-specific backend. + bool CheckSpelling(const std::string& word_to_check); + + // When called, relays the request to fill the list with suggestions to + // the proper backend, either hunspell or a platform-specific backend. + void FillSuggestionList(const std::string& wrong_word, + std::vector<std::wstring>* optional_suggestions); + // Download dictionary files when required. class DictionaryDownloadController; @@ -119,7 +130,7 @@ class SpellChecker : public base::RefCountedThreadSafe<SpellChecker> { bool Initialize(); // After |hunspell_| is initialized, this function is called to add custom - // words from the custom dictionary to the |hunspell_| + // words from the custom dictionary to the |hunspell_|. void AddCustomWordsToHunspell(); void set_file_is_downloading(bool value); @@ -191,6 +202,10 @@ class SpellChecker : public base::RefCountedThreadSafe<SpellChecker> { // Remember state for auto spell correct. bool auto_spell_correct_turned_on_; + // True if a platform-specific spellchecking engine is being used, + // and False if hunspell is being used. + bool is_using_platform_spelling_engine_; + // Used for generating callbacks to spellchecker, since spellchecker is a // non-reference counted object. The callback is generated by generating tasks // using NewRunableMethod on these objects. @@ -199,4 +214,4 @@ class SpellChecker : public base::RefCountedThreadSafe<SpellChecker> { DISALLOW_COPY_AND_ASSIGN(SpellChecker); }; -#endif // #ifndef CHROME_BROWSER_SPELLCHECKER_H_ +#endif // CHROME_BROWSER_SPELLCHECKER_H_ |