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

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

Issue 11293241: Cleaning up the custom dictionary code relative to the SpellcheckService to make the custom diction… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 0043bfbda273fe664f545f0472b907959219cc00..939a349e9f9558171afce10918fc2fd28d438383 100644
--- a/chrome/browser/spellchecker/spellcheck_custom_dictionary.h
+++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary.h
@@ -10,6 +10,7 @@
#include "base/file_path.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/spellchecker/spellcheck_dictionary.h"
#include "chrome/common/spellcheck_common.h"
@@ -30,6 +31,14 @@ class SpellcheckCustomDictionary : public SpellcheckDictionary {
void LoadDictionaryIntoCustomWordList(
chrome::spellcheck_common::WordList* custom_words);
+ // Adds the given word to the custom words list and inform renderer of the
+ // update.
+ void AddWord(const std::string& word);
+
+ // The reply point for PostTaskAndReply. Called when AddWord is finished
+ // adding a word in the background.
+ void AddWordComplete(const std::string& word);
+
private:
// In-memory cache of the custom words file.
chrome::spellcheck_common::WordList custom_words_;
@@ -37,6 +46,8 @@ class SpellcheckCustomDictionary : public SpellcheckDictionary {
// A path for custom dictionary per profile.
FilePath custom_dictionary_path_;
+ base::WeakPtrFactory<SpellcheckCustomDictionary> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(SpellcheckCustomDictionary);
};
« 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