Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(540)

Unified Diff: chrome/browser/spellchecker/spellcheck_custom_dictionary.h

Issue 15940004: Add HasWord(string) method to SpellcheckCustomDictionary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Clarified message direction (browser-to-renderer) in spellcheck_messages.h Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/spellchecker/spellcheck_custom_dictionary.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/spellchecker/spellcheck_custom_dictionary.h
diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary.h b/chrome/browser/spellchecker/spellcheck_custom_dictionary.h
index 3854156dc7e94e721cc765bae98385e52885e75e..e54b6fac2be0adac17531c323e86ea93f113c4de 100644
--- a/chrome/browser/spellchecker/spellcheck_custom_dictionary.h
+++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary.h
@@ -45,7 +45,7 @@ class SpellcheckCustomDictionary : public SpellcheckDictionary,
// invalid words from words to be added, removing missing words from words
// to be removed, and sorting both lists of words. Assumes that |words| is
// sorted. Returns a bitmap of |ChangeSanitationResult| values.
- int Sanitize(const chrome::spellcheck_common::WordList& words);
+ int Sanitize(const chrome::spellcheck_common::WordSet& words);
// Returns the words to be added in this change.
const chrome::spellcheck_common::WordList& to_add() const;
@@ -78,7 +78,7 @@ class SpellcheckCustomDictionary : public SpellcheckDictionary,
virtual ~SpellcheckCustomDictionary();
// Returns the in-memory cache of words in the custom dictionary.
- const chrome::spellcheck_common::WordList& GetWords() const;
+ const chrome::spellcheck_common::WordSet& GetWords() const;
// Adds |word| to the dictionary, schedules a write to disk, and notifies
// observers of the change. Returns true if |word| is valid and not a
@@ -90,6 +90,9 @@ class SpellcheckCustomDictionary : public SpellcheckDictionary,
// returns false.
bool RemoveWord(const std::string& word);
+ // Returns true if the dictionary contains |word|. Otherwise returns false.
+ bool HasWord(const std::string& word);
+
// Adds |observer| to be notified of dictionary events and changes.
void AddObserver(Observer* observer);
@@ -158,7 +161,7 @@ class SpellcheckCustomDictionary : public SpellcheckDictionary,
void Notify(const Change& dictionary_change);
// In-memory cache of the custom words file.
- chrome::spellcheck_common::WordList words_;
+ chrome::spellcheck_common::WordSet words_;
// A path for custom dictionary.
base::FilePath custom_dictionary_path_;
« no previous file with comments | « no previous file | chrome/browser/spellchecker/spellcheck_custom_dictionary.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698