OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SPELLCHECKER_SPELLCHECK_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_ |
6 #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_ | 6 #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // Dictionary format used for loading an external dictionary. | 47 // Dictionary format used for loading an external dictionary. |
48 enum DictionaryFormat { | 48 enum DictionaryFormat { |
49 DICT_HUNSPELL, | 49 DICT_HUNSPELL, |
50 DICT_TEXT, | 50 DICT_TEXT, |
51 DICT_UNKNOWN, | 51 DICT_UNKNOWN, |
52 }; | 52 }; |
53 | 53 |
54 explicit SpellcheckService(content::BrowserContext* context); | 54 explicit SpellcheckService(content::BrowserContext* context); |
55 ~SpellcheckService() override; | 55 ~SpellcheckService() override; |
56 | 56 |
| 57 base::WeakPtr<SpellcheckService> GetWeakPtr(); |
| 58 |
57 // This function computes a vector of strings which are to be displayed in | 59 // This function computes a vector of strings which are to be displayed in |
58 // the context menu over a text area for changing spell check languages. It | 60 // the context menu over a text area for changing spell check languages. It |
59 // returns the index of the current spell check language in the vector. | 61 // returns the index of the current spell check language in the vector. |
60 // TODO(port): this should take a vector of base::string16, but the | 62 // TODO(port): this should take a vector of base::string16, but the |
61 // implementation has some dependencies in l10n util that need porting first. | 63 // implementation has some dependencies in l10n util that need porting first. |
62 static int GetSpellCheckLanguages(content::BrowserContext* context, | 64 static int GetSpellCheckLanguages(content::BrowserContext* context, |
63 std::vector<std::string>* languages); | 65 std::vector<std::string>* languages); |
64 | 66 |
65 // Computes a vector of strings which are to be displayed in the context | 67 // Computes a vector of strings which are to be displayed in the context |
66 // menu from |accept_languages| and |dictionary_language|. | 68 // menu from |accept_languages| and |dictionary_language|. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 scoped_ptr<SpellcheckCustomDictionary> custom_dictionary_; | 156 scoped_ptr<SpellcheckCustomDictionary> custom_dictionary_; |
155 | 157 |
156 scoped_ptr<SpellcheckHunspellDictionary> hunspell_dictionary_; | 158 scoped_ptr<SpellcheckHunspellDictionary> hunspell_dictionary_; |
157 | 159 |
158 base::WeakPtrFactory<SpellcheckService> weak_ptr_factory_; | 160 base::WeakPtrFactory<SpellcheckService> weak_ptr_factory_; |
159 | 161 |
160 DISALLOW_COPY_AND_ASSIGN(SpellcheckService); | 162 DISALLOW_COPY_AND_ASSIGN(SpellcheckService); |
161 }; | 163 }; |
162 | 164 |
163 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_ | 165 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_ |
OLD | NEW |