| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/ui/webui/options/options_ui.h" | 9 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 10 | 10 |
| 11 namespace base { | 11 namespace base { |
| 12 class DictionaryValue; | 12 class DictionaryValue; |
| 13 class ListValue; | 13 class ListValue; |
| 14 } | 14 } |
| 15 | 15 |
| 16 // The base class for language options page UI handlers. This class has code | 16 // The base class for language options page UI handlers. This class has code |
| 17 // common to the Chrome OS and non-Chrome OS implementation of the handler. | 17 // common to the Chrome OS and non-Chrome OS implementation of the handler. |
| 18 class LanguageOptionsHandlerCommon : public OptionsPageUIHandler { | 18 class LanguageOptionsHandlerCommon : public OptionsPageUIHandler { |
| 19 public: | 19 public: |
| 20 LanguageOptionsHandlerCommon(); | 20 LanguageOptionsHandlerCommon(); |
| 21 virtual ~LanguageOptionsHandlerCommon(); | 21 virtual ~LanguageOptionsHandlerCommon(); |
| 22 | 22 |
| 23 // OptionsPageUIHandler implementation. | 23 // OptionsPageUIHandler implementation. |
| 24 virtual void GetLocalizedValues(base::DictionaryValue* localized_strings); | 24 virtual void GetLocalizedValues( |
| 25 base::DictionaryValue* localized_strings) OVERRIDE; |
| 25 | 26 |
| 26 // DOMMessageHandler implementation. | 27 // DOMMessageHandler implementation. |
| 27 virtual void RegisterMessages(); | 28 virtual void RegisterMessages() OVERRIDE; |
| 28 | 29 |
| 29 // The following static methods are public for ease of testing. | 30 // The following static methods are public for ease of testing. |
| 30 | 31 |
| 31 // Gets the set of language codes that can be used as UI language. | 32 // Gets the set of language codes that can be used as UI language. |
| 32 // The return value will look like: | 33 // The return value will look like: |
| 33 // {'en-US': true, 'fi': true, 'fr': true, ...} | 34 // {'en-US': true, 'fi': true, 'fr': true, ...} |
| 34 // | 35 // |
| 35 // Note that true in values does not mean anything. We just use the | 36 // Note that true in values does not mean anything. We just use the |
| 36 // dictionary as a set. | 37 // dictionary as a set. |
| 37 static base::DictionaryValue* GetUILanguageCodeSet(); | 38 static base::DictionaryValue* GetUILanguageCodeSet(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 59 void UiLanguageChangeCallback(const base::ListValue* args); | 60 void UiLanguageChangeCallback(const base::ListValue* args); |
| 60 | 61 |
| 61 // Called when the spell check language is changed. | 62 // Called when the spell check language is changed. |
| 62 // |args| will contain the language code as string (ex. "fr"). | 63 // |args| will contain the language code as string (ex. "fr"). |
| 63 void SpellCheckLanguageChangeCallback(const base::ListValue* args); | 64 void SpellCheckLanguageChangeCallback(const base::ListValue* args); |
| 64 | 65 |
| 65 DISALLOW_COPY_AND_ASSIGN(LanguageOptionsHandlerCommon); | 66 DISALLOW_COPY_AND_ASSIGN(LanguageOptionsHandlerCommon); |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_COMMON_H_ | 69 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_COMMON_H_ |
| OLD | NEW |