| 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_UI_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_COMMON_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_COMMON_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_COMMON_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_COMMON_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" | 9 #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" |
| 10 #include "chrome/browser/ui/webui/options/options_ui.h" | 10 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class DictionaryValue; | 13 class DictionaryValue; |
| 14 class ListValue; | 14 class ListValue; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace options { | 17 namespace options { |
| 18 | 18 |
| 19 // The base class for language options page UI handlers. This class has code | 19 // The base class for language options page UI handlers. This class has code |
| 20 // common to the Chrome OS and non-Chrome OS implementation of the handler. | 20 // common to the Chrome OS and non-Chrome OS implementation of the handler. |
| 21 class LanguageOptionsHandlerCommon | 21 class LanguageOptionsHandlerCommon |
| 22 : public OptionsPageUIHandler, | 22 : public OptionsPageUIHandler, |
| 23 public SpellcheckHunspellDictionary::Observer { | 23 public SpellcheckHunspellDictionary::Observer { |
| 24 public: | 24 public: |
| 25 LanguageOptionsHandlerCommon(); | 25 LanguageOptionsHandlerCommon(); |
| 26 virtual ~LanguageOptionsHandlerCommon(); | 26 virtual ~LanguageOptionsHandlerCommon(); |
| 27 | 27 |
| 28 // OptionsPageUIHandler implementation. | 28 // OptionsPageUIHandler implementation. |
| 29 virtual void GetLocalizedValues( | 29 virtual void GetLocalizedValues( |
| 30 base::DictionaryValue* localized_strings) OVERRIDE; | 30 base::DictionaryValue* localized_strings) override; |
| 31 virtual void Uninitialize() OVERRIDE; | 31 virtual void Uninitialize() override; |
| 32 | 32 |
| 33 // DOMMessageHandler implementation. | 33 // DOMMessageHandler implementation. |
| 34 virtual void RegisterMessages() OVERRIDE; | 34 virtual void RegisterMessages() override; |
| 35 | 35 |
| 36 // SpellcheckHunspellDictionary::Observer implementation. | 36 // SpellcheckHunspellDictionary::Observer implementation. |
| 37 virtual void OnHunspellDictionaryInitialized() OVERRIDE; | 37 virtual void OnHunspellDictionaryInitialized() override; |
| 38 virtual void OnHunspellDictionaryDownloadBegin() OVERRIDE; | 38 virtual void OnHunspellDictionaryDownloadBegin() override; |
| 39 virtual void OnHunspellDictionaryDownloadSuccess() OVERRIDE; | 39 virtual void OnHunspellDictionaryDownloadSuccess() override; |
| 40 virtual void OnHunspellDictionaryDownloadFailure() OVERRIDE; | 40 virtual void OnHunspellDictionaryDownloadFailure() override; |
| 41 | 41 |
| 42 // The following static methods are public for ease of testing. | 42 // The following static methods are public for ease of testing. |
| 43 | 43 |
| 44 // Gets the set of language codes that can be used as UI language. | 44 // Gets the set of language codes that can be used as UI language. |
| 45 // The return value will look like: | 45 // The return value will look like: |
| 46 // {'en-US': true, 'fi': true, 'fr': true, ...} | 46 // {'en-US': true, 'fi': true, 'fr': true, ...} |
| 47 // | 47 // |
| 48 // Note that true in values does not mean anything. We just use the | 48 // Note that true in values does not mean anything. We just use the |
| 49 // dictionary as a set. | 49 // dictionary as a set. |
| 50 static base::DictionaryValue* GetUILanguageCodeSet(); | 50 static base::DictionaryValue* GetUILanguageCodeSet(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 // The hunspell dictionary that is used for spellchecking. Might be null. | 91 // The hunspell dictionary that is used for spellchecking. Might be null. |
| 92 base::WeakPtr<SpellcheckHunspellDictionary> hunspell_dictionary_; | 92 base::WeakPtr<SpellcheckHunspellDictionary> hunspell_dictionary_; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(LanguageOptionsHandlerCommon); | 94 DISALLOW_COPY_AND_ASSIGN(LanguageOptionsHandlerCommon); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace options | 97 } // namespace options |
| 98 | 98 |
| 99 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_COMMON_H_ | 99 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_COMMON_H_ |
| OLD | NEW |