summaryrefslogtreecommitdiffstats
path: root/chrome/browser/spellchecker_platform_engine.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 19:17:32 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 19:17:32 +0000
commit2a3a7764dc3343682a888f194c59b9ad48729e4b (patch)
treea99a6831e8ae561ff3230b254496aa3705684ef2 /chrome/browser/spellchecker_platform_engine.h
parent58ce21e623685e1e7b4c97ed7d59fbfb9c8e9801 (diff)
downloadchromium_src-2a3a7764dc3343682a888f194c59b9ad48729e4b.zip
chromium_src-2a3a7764dc3343682a888f194c59b9ad48729e4b.tar.gz
chromium_src-2a3a7764dc3343682a888f194c59b9ad48729e4b.tar.bz2
Convert the spellchecker and associated messages and functions to use string16
for words instead of wstring. I also changed some places where it converted the word to a string to do that conversion at the last possible second before giving it to Hunspell (since this conversion isn't needed for Mac). TEST=Covered by unit tests BUG=none Review URL: http://codereview.chromium.org/274077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29435 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/spellchecker_platform_engine.h')
-rw-r--r--chrome/browser/spellchecker_platform_engine.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/chrome/browser/spellchecker_platform_engine.h b/chrome/browser/spellchecker_platform_engine.h
index bf5eb94..d9a0588 100644
--- a/chrome/browser/spellchecker_platform_engine.h
+++ b/chrome/browser/spellchecker_platform_engine.h
@@ -11,9 +11,11 @@
#include <string>
#include <vector>
+#include "base/string16.h"
#include "chrome/browser/spellchecker_common.h"
namespace SpellCheckerPlatform {
+
// Get the languages supported by the platform spellchecker and store them in
// |spellcheck_languages|. Note that they must be converted to
// Chromium style codes (en-US not en_US). See spellchecker.cc for a full list.
@@ -33,7 +35,7 @@ void ShowSpellingPanel(bool show);
// Changes the word show in the spelling panel to be |word|. Note that the
// spelling panel need not be displayed for this to work.
-void UpdateSpellingPanelWithMisspelledWord(const std::wstring& word);
+void UpdateSpellingPanelWithMisspelledWord(const string16& word);
// Do any initialization needed for spellchecker.
void Init();
@@ -50,19 +52,19 @@ void SetLanguage(const std::string& lang_to_set);
// Checks the spelling of the given string, using the platform-specific
// spellchecker. Returns true if the word is spelled correctly.
-bool CheckSpelling(const std::string& word_to_check, int tag);
+bool CheckSpelling(const string16& word_to_check, int tag);
// Fills the given vector |optional_suggestions| with a number (up to
// kMaxSuggestions, which is defined in spellchecker_common.h) of suggestions
// for the string |wrong_word|.
-void FillSuggestionList(const std::string& wrong_word,
- std::vector<std::wstring>* optional_suggestions);
+void FillSuggestionList(const string16& wrong_word,
+ std::vector<string16>* optional_suggestions);
// Adds the given word to the platform dictionary.
-void AddWord(const std::wstring& word);
+void AddWord(const string16& word);
// Remove a given word from the platform dictionary.
-void RemoveWord(const std::wstring& word);
+void RemoveWord(const string16& word);
// Gets a unique tag to identify a document. Used in ignoring words.
int GetDocumentTag();
@@ -72,12 +74,13 @@ int GetDocumentTag();
// the tag for sure is to ask the renderer, which would mean blocking in the
// browser, so (on the mac, anyway) we remember the most recent tag and use
// it, since it should always be from the same document.
-void IgnoreWord(const std::string& word);
+void IgnoreWord(const string16& word);
// Tells the platform spellchecker that a document associated with a tag has
// closed. Generally, this means that any ignored words associated with that
// document can now be forgotten.
void CloseDocumentWithTag(int tag);
-}
+
+} // namespace SpellCheckerPlatform
#endif // CHROME_BROWSER_SPELLCHECKER_PLATFORM_ENGINE_H_