| 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_CHROMEOS_CROS_LANGUAGE_OPTIONS_HANDLER_H
_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CROS_LANGUAGE_OPTIONS_HANDLER_H
_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CROS_LANGUAGE_OPTIONS_HANDLER_H
_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CROS_LANGUAGE_OPTIONS_HANDLER_H
_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "chrome/browser/ui/webui/options/language_options_handler.h" | 9 #include "chrome/browser/ui/webui/options/language_options_handler.h" |
| 10 #include "chromeos/ime/component_extension_ime_manager.h" | 10 #include "chromeos/ime/component_extension_ime_manager.h" |
| 11 #include "chromeos/ime/input_method_descriptor.h" | 11 #include "chromeos/ime/input_method_descriptor.h" |
| 12 | 12 |
| 13 namespace chromeos { | 13 namespace chromeos { |
| 14 namespace options { | 14 namespace options { |
| 15 | 15 |
| 16 // GetUILanguageList() returns concatenated list of list of vendor languages | 16 // GetUILanguageList() returns concatenated list of list of vendor languages |
| 17 // followed by other languages. An entry with "code" attribute set to this value | 17 // followed by other languages. An entry with "code" attribute set to this value |
| 18 // is inserted in between. | 18 // is inserted in between. |
| 19 extern const char kVendorOtherLanguagesListDivider[]; | 19 extern const char kVendorOtherLanguagesListDivider[]; |
| 20 | 20 |
| 21 // Language options page UI handler for Chrome OS. For non-Chrome OS, | 21 // Language options page UI handler for Chrome OS. For non-Chrome OS, |
| 22 // see LanguageOptionsHnadler. | 22 // see LanguageOptionsHnadler. |
| 23 class CrosLanguageOptionsHandler | 23 class CrosLanguageOptionsHandler |
| 24 : public ::options::LanguageOptionsHandlerCommon, | 24 : public ::options::LanguageOptionsHandlerCommon { |
| 25 public ComponentExtensionIMEManager::Observer { | |
| 26 public: | 25 public: |
| 27 CrosLanguageOptionsHandler(); | 26 CrosLanguageOptionsHandler(); |
| 28 virtual ~CrosLanguageOptionsHandler(); | 27 virtual ~CrosLanguageOptionsHandler(); |
| 29 | 28 |
| 30 // OptionsPageUIHandler implementation. | 29 // OptionsPageUIHandler implementation. |
| 31 virtual void GetLocalizedValues( | 30 virtual void GetLocalizedValues( |
| 32 base::DictionaryValue* localized_strings) OVERRIDE; | 31 base::DictionaryValue* localized_strings) OVERRIDE; |
| 33 | 32 |
| 34 // DOMMessageHandler implementation. | 33 // DOMMessageHandler implementation. |
| 35 virtual void RegisterMessages() OVERRIDE; | 34 virtual void RegisterMessages() OVERRIDE; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void InputMethodDisableCallback(const base::ListValue* args); | 86 void InputMethodDisableCallback(const base::ListValue* args); |
| 88 | 87 |
| 89 // Called when the input method is enabled. | 88 // Called when the input method is enabled. |
| 90 // |args| will contain the input method ID as string (ex. "mozc"). | 89 // |args| will contain the input method ID as string (ex. "mozc"). |
| 91 void InputMethodEnableCallback(const base::ListValue* args); | 90 void InputMethodEnableCallback(const base::ListValue* args); |
| 92 | 91 |
| 93 // Called when the input method options page is opened. | 92 // Called when the input method options page is opened. |
| 94 // |args| will contain the input method ID as string (ex. "mozc"). | 93 // |args| will contain the input method ID as string (ex. "mozc"). |
| 95 void InputMethodOptionsOpenCallback(const base::ListValue* args); | 94 void InputMethodOptionsOpenCallback(const base::ListValue* args); |
| 96 | 95 |
| 97 // ComponentExtensionIMEManager::Observer override. | |
| 98 virtual void OnImeComponentExtensionInitialized() OVERRIDE; | |
| 99 | |
| 100 // Gets the list of languages with |descriptors| based on | 96 // Gets the list of languages with |descriptors| based on |
| 101 // |base_language_codes|. | 97 // |base_language_codes|. |
| 102 // |insert_divider| means to insert entry with "code" attribute set to | 98 // |insert_divider| means to insert entry with "code" attribute set to |
| 103 // kVendorOtherLanguagesListDivider between "most relevant" languages and | 99 // kVendorOtherLanguagesListDivider between "most relevant" languages and |
| 104 // other. | 100 // other. |
| 105 static base::ListValue* GetLanguageListInternal( | 101 static base::ListValue* GetLanguageListInternal( |
| 106 const input_method::InputMethodDescriptors& descriptors, | 102 const input_method::InputMethodDescriptors& descriptors, |
| 107 const std::vector<std::string>& base_language_codes, | 103 const std::vector<std::string>& base_language_codes, |
| 108 bool insert_divider); | 104 bool insert_divider); |
| 109 | 105 |
| 110 // OptionsPageUIHandler implementation. | |
| 111 virtual void InitializePage() OVERRIDE; | |
| 112 | |
| 113 // Adds the name of the extension that provides the IME to each entry in the | 106 // Adds the name of the extension that provides the IME to each entry in the |
| 114 // |list| of extension IMEs. | 107 // |list| of extension IMEs. |
| 115 void AddImeProvider(base::ListValue* list); | 108 void AddImeProvider(base::ListValue* list); |
| 116 | 109 |
| 117 // True if the component extension list was appended into input method list. | |
| 118 bool composition_extension_appended_; | |
| 119 | |
| 120 // True if this page was initialized. | |
| 121 bool is_page_initialized_; | |
| 122 | |
| 123 DISALLOW_COPY_AND_ASSIGN(CrosLanguageOptionsHandler); | 110 DISALLOW_COPY_AND_ASSIGN(CrosLanguageOptionsHandler); |
| 124 }; | 111 }; |
| 125 | 112 |
| 126 } // namespace options | 113 } // namespace options |
| 127 } // namespace chromeos | 114 } // namespace chromeos |
| 128 | 115 |
| 129 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CROS_LANGUAGE_OPTIONS_HANDLE
R_H_ | 116 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CROS_LANGUAGE_OPTIONS_HANDLE
R_H_ |
| OLD | NEW |