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

Unified Diff: chrome/browser/extensions/api/language_settings_private/language_settings_private_api.h

Issue 1373073003: Implement chrome.languageSettingsPrivate custom spell check functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@LanguagePage1EditIndividual
Patch Set: rebase on histogram fixes Created 5 years, 2 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/extensions/api/language_settings_private/language_settings_private_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/language_settings_private/language_settings_private_api.h
diff --git a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.h b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.h
index 7d22108ce24a7dfa2cf2f554c6baf52d10d58366..17027547a7ef33463c9d9d7994998f475722cb1c 100644
--- a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.h
+++ b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.h
@@ -73,7 +73,8 @@ class LanguageSettingsPrivateGetSpellcheckDictionaryStatusesFunction
// Implements the languageSettingsPrivate.getSpellcheckWords method.
class LanguageSettingsPrivateGetSpellcheckWordsFunction
- : public UIThreadExtensionFunction {
+ : public UIThreadExtensionFunction,
+ public SpellcheckCustomDictionary::Observer {
public:
LanguageSettingsPrivateGetSpellcheckWordsFunction();
DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.getSpellcheckWords",
@@ -85,10 +86,54 @@ class LanguageSettingsPrivateGetSpellcheckWordsFunction
// ExtensionFunction overrides.
ResponseAction Run() override;
+ // SpellcheckCustomDictionary::Observer overrides.
+ void OnCustomDictionaryLoaded() override;
+ void OnCustomDictionaryChanged(
+ const SpellcheckCustomDictionary::Change& dictionary_change) override;
+
+ // Returns the list of words from the loaded custom dictionary.
+ scoped_ptr<base::ListValue> GetSpellcheckWords() const;
+
private:
DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateGetSpellcheckWordsFunction);
};
+// Implements the languageSettingsPrivate.addSpellcheckWord method.
+class LanguageSettingsPrivateAddSpellcheckWordFunction
+ : public UIThreadExtensionFunction {
+ public:
+ LanguageSettingsPrivateAddSpellcheckWordFunction();
+ DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.addSpellcheckWord",
+ LANGUAGESETTINGSPRIVATE_ADDSPELLCHECKWORD)
+
+ protected:
+ ~LanguageSettingsPrivateAddSpellcheckWordFunction() override;
+
+ // ExtensionFunction overrides.
+ ResponseAction Run() override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateAddSpellcheckWordFunction);
+};
+
+// Implements the languageSettingsPrivate.removeSpellcheckWord method.
+class LanguageSettingsPrivateRemoveSpellcheckWordFunction
+ : public UIThreadExtensionFunction {
+ public:
+ LanguageSettingsPrivateRemoveSpellcheckWordFunction();
+ DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.removeSpellcheckWord",
+ LANGUAGESETTINGSPRIVATE_REMOVESPELLCHECKWORD)
+
+ protected:
+ ~LanguageSettingsPrivateRemoveSpellcheckWordFunction() override;
+
+ // ExtensionFunction overrides.
+ ResponseAction Run() override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateRemoveSpellcheckWordFunction);
+};
+
// Implements the languageSettingsPrivate.getTranslateTargetLanguage method.
class LanguageSettingsPrivateGetTranslateTargetLanguageFunction
: public UIThreadExtensionFunction {
« no previous file with comments | « no previous file | chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698