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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_LANGUAGE_SETTINGS_PRIVATE_LANGUAGE_SETTING S_PRIVATE_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_LANGUAGE_SETTINGS_PRIVATE_LANGUAGE_SETTING S_PRIVATE_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_LANGUAGE_SETTINGS_PRIVATE_LANGUAGE_SETTING S_PRIVATE_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_LANGUAGE_SETTINGS_PRIVATE_LANGUAGE_SETTING S_PRIVATE_API_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/extensions/chrome_extension_function_details.h" 9 #include "chrome/browser/extensions/chrome_extension_function_details.h"
10 #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h" 10 #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // ExtensionFunction overrides. 66 // ExtensionFunction overrides.
67 ResponseAction Run() override; 67 ResponseAction Run() override;
68 68
69 private: 69 private:
70 DISALLOW_COPY_AND_ASSIGN( 70 DISALLOW_COPY_AND_ASSIGN(
71 LanguageSettingsPrivateGetSpellcheckDictionaryStatusesFunction); 71 LanguageSettingsPrivateGetSpellcheckDictionaryStatusesFunction);
72 }; 72 };
73 73
74 // Implements the languageSettingsPrivate.getSpellcheckWords method. 74 // Implements the languageSettingsPrivate.getSpellcheckWords method.
75 class LanguageSettingsPrivateGetSpellcheckWordsFunction 75 class LanguageSettingsPrivateGetSpellcheckWordsFunction
76 : public UIThreadExtensionFunction { 76 : public UIThreadExtensionFunction,
77 public SpellcheckCustomDictionary::Observer {
77 public: 78 public:
78 LanguageSettingsPrivateGetSpellcheckWordsFunction(); 79 LanguageSettingsPrivateGetSpellcheckWordsFunction();
79 DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.getSpellcheckWords", 80 DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.getSpellcheckWords",
80 LANGUAGESETTINGSPRIVATE_GETSPELLCHECKWORDS) 81 LANGUAGESETTINGSPRIVATE_GETSPELLCHECKWORDS)
81 82
82 protected: 83 protected:
83 ~LanguageSettingsPrivateGetSpellcheckWordsFunction() override; 84 ~LanguageSettingsPrivateGetSpellcheckWordsFunction() override;
84 85
85 // ExtensionFunction overrides. 86 // ExtensionFunction overrides.
86 ResponseAction Run() override; 87 ResponseAction Run() override;
87 88
89 // SpellcheckCustomDictionary::Observer overrides.
90 void OnCustomDictionaryLoaded() override;
91 void OnCustomDictionaryChanged(
92 const SpellcheckCustomDictionary::Change& dictionary_change) override;
93
94 // Returns the list of words from the loaded custom dictionary.
95 scoped_ptr<base::ListValue> GetSpellcheckWords() const;
96
88 private: 97 private:
89 DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateGetSpellcheckWordsFunction); 98 DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateGetSpellcheckWordsFunction);
90 }; 99 };
91 100
101 // Implements the languageSettingsPrivate.addSpellcheckWord method.
102 class LanguageSettingsPrivateAddSpellcheckWordFunction
103 : public UIThreadExtensionFunction {
104 public:
105 LanguageSettingsPrivateAddSpellcheckWordFunction();
106 DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.addSpellcheckWord",
107 LANGUAGESETTINGSPRIVATE_ADDSPELLCHECKWORD)
108
109 protected:
110 ~LanguageSettingsPrivateAddSpellcheckWordFunction() override;
111
112 // ExtensionFunction overrides.
113 ResponseAction Run() override;
114
115 private:
116 DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateAddSpellcheckWordFunction);
117 };
118
119 // Implements the languageSettingsPrivate.removeSpellcheckWord method.
120 class LanguageSettingsPrivateRemoveSpellcheckWordFunction
121 : public UIThreadExtensionFunction {
122 public:
123 LanguageSettingsPrivateRemoveSpellcheckWordFunction();
124 DECLARE_EXTENSION_FUNCTION("languageSettingsPrivate.removeSpellcheckWord",
125 LANGUAGESETTINGSPRIVATE_REMOVESPELLCHECKWORD)
126
127 protected:
128 ~LanguageSettingsPrivateRemoveSpellcheckWordFunction() override;
129
130 // ExtensionFunction overrides.
131 ResponseAction Run() override;
132
133 private:
134 DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateRemoveSpellcheckWordFunction);
135 };
136
92 // Implements the languageSettingsPrivate.getTranslateTargetLanguage method. 137 // Implements the languageSettingsPrivate.getTranslateTargetLanguage method.
93 class LanguageSettingsPrivateGetTranslateTargetLanguageFunction 138 class LanguageSettingsPrivateGetTranslateTargetLanguageFunction
94 : public UIThreadExtensionFunction { 139 : public UIThreadExtensionFunction {
95 public: 140 public:
96 LanguageSettingsPrivateGetTranslateTargetLanguageFunction(); 141 LanguageSettingsPrivateGetTranslateTargetLanguageFunction();
97 DECLARE_EXTENSION_FUNCTION( 142 DECLARE_EXTENSION_FUNCTION(
98 "languageSettingsPrivate.getTranslateTargetLanguage", 143 "languageSettingsPrivate.getTranslateTargetLanguage",
99 LANGUAGESETTINGSPRIVATE_GETTRANSLATETARGETLANGUAGE) 144 LANGUAGESETTINGSPRIVATE_GETTRANSLATETARGETLANGUAGE)
100 145
101 protected: 146 protected:
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // ExtensionFunction overrides. 206 // ExtensionFunction overrides.
162 ResponseAction Run() override; 207 ResponseAction Run() override;
163 208
164 private: 209 private:
165 DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateRemoveInputMethodFunction); 210 DISALLOW_COPY_AND_ASSIGN(LanguageSettingsPrivateRemoveInputMethodFunction);
166 }; 211 };
167 212
168 } // namespace extensions 213 } // namespace extensions
169 214
170 #endif // CHROME_BROWSER_EXTENSIONS_API_LANGUAGE_SETTINGS_PRIVATE_LANGUAGE_SETT INGS_PRIVATE_API_H_ 215 #endif // CHROME_BROWSER_EXTENSIONS_API_LANGUAGE_SETTINGS_PRIVATE_LANGUAGE_SETT INGS_PRIVATE_API_H_
OLDNEW
« 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