Chromium Code Reviews| Index: chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc |
| diff --git a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc |
| index 3c31fccf733cf60ed4d0e8b06112999b837e375c..150405c0c5eebb06eb95512d70491bed40b3ad25 100644 |
| --- a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc |
| +++ b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc |
| @@ -63,13 +63,9 @@ const char kVendorOtherLanguagesListDivider[] = |
| CrosLanguageOptionsHandler::CrosLanguageOptionsHandler() |
| : composition_extension_appended_(false), |
| is_page_initialized_(false) { |
| - input_method::InputMethodManager::Get()->GetComponentExtensionIMEManager()-> |
| - AddObserver(this); |
| } |
| CrosLanguageOptionsHandler::~CrosLanguageOptionsHandler() { |
| - input_method::InputMethodManager::Get()->GetComponentExtensionIMEManager()-> |
| - RemoveObserver(this); |
| } |
| void CrosLanguageOptionsHandler::GetLocalizedValues( |
| @@ -128,18 +124,11 @@ void CrosLanguageOptionsHandler::GetLocalizedValues( |
| ComponentExtensionIMEManager* component_extension_manager = |
| input_method::InputMethodManager::Get() |
| ->GetComponentExtensionIMEManager(); |
| - if (component_extension_manager->IsInitialized()) { |
| - localized_strings->Set( |
| - "componentExtensionImeList", |
| - ConvertInputMethodDescriptorsToIMEList( |
| - component_extension_manager->GetAllIMEAsInputMethodDescriptor())); |
| - composition_extension_appended_ = true; |
| - } else { |
| - // If component extension IME manager is not ready for use, it will be |
| - // added in |InitializePage()|. |
| - localized_strings->Set("componentExtensionImeList", |
| - new base::ListValue()); |
| - } |
| + localized_strings->Set( |
| + "componentExtensionImeList", |
| + ConvertInputMethodDescriptorsToIMEList( |
| + component_extension_manager->GetAllIMEAsInputMethodDescriptor())); |
| + composition_extension_appended_ = true; |
| } |
| void CrosLanguageOptionsHandler::RegisterMessages() { |
| @@ -509,27 +498,6 @@ void CrosLanguageOptionsHandler::InputMethodOptionsOpenCallback( |
| web_contents->GetDelegate()->ActivateContents(web_contents); |
| } |
| -void CrosLanguageOptionsHandler::OnImeComponentExtensionInitialized() { |
| - if (composition_extension_appended_ || !is_page_initialized_) { |
| - // If an option page is not ready to call JavaScript, appending component |
| - // extension IMEs will be done in InitializePage function later. |
| - return; |
| - } |
| - |
| - ComponentExtensionIMEManager* manager = |
| - input_method::InputMethodManager::Get() |
| - ->GetComponentExtensionIMEManager(); |
| - |
| - DCHECK(manager->IsInitialized()); |
| - scoped_ptr<base::ListValue> ime_list( |
| - ConvertInputMethodDescriptorsToIMEList( |
| - manager->GetAllIMEAsInputMethodDescriptor())); |
| - web_ui()->CallJavascriptFunction( |
| - "options.LanguageOptions.onComponentManagerInitialized", |
| - *ime_list); |
| - composition_extension_appended_ = true; |
| -} |
| - |
| void CrosLanguageOptionsHandler::InitializePage() { |
| is_page_initialized_ = true; |
| if (composition_extension_appended_) |
|
Alexander Alekseev
2014/07/14 14:07:29
It seems that IME is now accessed in GetLocalizedV
Shu Chen
2014/07/14 15:07:21
Done.
|
| @@ -538,11 +506,6 @@ void CrosLanguageOptionsHandler::InitializePage() { |
| ComponentExtensionIMEManager* component_extension_manager = |
| input_method::InputMethodManager::Get() |
| ->GetComponentExtensionIMEManager(); |
| - if (!component_extension_manager->IsInitialized()) { |
| - // If the component extension IME manager is not available yet, append the |
| - // component extension list in |OnInitialized()|. |
| - return; |
| - } |
| scoped_ptr<base::ListValue> ime_list( |
| ConvertInputMethodDescriptorsToIMEList( |