Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc

Issue 419293002: IME refactoring: ChromeOS introduce input methods State. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test fixed. Re-sorted methods of StateImpl and IMM. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "chrome/browser/ui/webui/options/chromeos/cros_language_options_handler .h" 5 #include "chrome/browser/ui/webui/options/chromeos/cros_language_options_handler .h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 l10n_util::GetStringUTF16( 83 l10n_util::GetStringUTF16(
84 IDS_OPTIONS_SETTINGS_LANGUAGES_NO_INPUT_METHODS)); 84 IDS_OPTIONS_SETTINGS_LANGUAGES_NO_INPUT_METHODS));
85 85
86 // GetSupportedInputMethods() never returns NULL. 86 // GetSupportedInputMethods() never returns NULL.
87 localized_strings->Set("languageList", GetAcceptLanguageList().release()); 87 localized_strings->Set("languageList", GetAcceptLanguageList().release());
88 localized_strings->Set("inputMethodList", GetInputMethodList()); 88 localized_strings->Set("inputMethodList", GetInputMethodList());
89 89
90 input_method::InputMethodManager* manager = 90 input_method::InputMethodManager* manager =
91 input_method::InputMethodManager::Get(); 91 input_method::InputMethodManager::Get();
92 input_method::InputMethodDescriptors ext_ime_descriptors; 92 input_method::InputMethodDescriptors ext_ime_descriptors;
93 manager->GetInputMethodExtensions(&ext_ime_descriptors); 93 manager->GetActiveIMEState()->GetInputMethodExtensions(&ext_ime_descriptors);
94 94
95 base::ListValue* ext_ime_list = ConvertInputMethodDescriptorsToIMEList( 95 base::ListValue* ext_ime_list = ConvertInputMethodDescriptorsToIMEList(
96 ext_ime_descriptors); 96 ext_ime_descriptors);
97 AddImeProvider(ext_ime_list); 97 AddImeProvider(ext_ime_list);
98 localized_strings->Set("extensionImeList", ext_ime_list); 98 localized_strings->Set("extensionImeList", ext_ime_list);
99 99
100 ComponentExtensionIMEManager* component_extension_manager = 100 ComponentExtensionIMEManager* component_extension_manager =
101 input_method::InputMethodManager::Get() 101 input_method::InputMethodManager::Get()
102 ->GetComponentExtensionIMEManager(); 102 ->GetComponentExtensionIMEManager();
103 localized_strings->Set( 103 localized_strings->Set(
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 void CrosLanguageOptionsHandler::InputMethodOptionsOpenCallback( 222 void CrosLanguageOptionsHandler::InputMethodOptionsOpenCallback(
223 const base::ListValue* args) { 223 const base::ListValue* args) {
224 const std::string input_method_id = 224 const std::string input_method_id =
225 base::UTF16ToASCII(ExtractStringValue(args)); 225 base::UTF16ToASCII(ExtractStringValue(args));
226 const std::string extension_id = 226 const std::string extension_id =
227 extension_ime_util::GetExtensionIDFromInputMethodID(input_method_id); 227 extension_ime_util::GetExtensionIDFromInputMethodID(input_method_id);
228 if (extension_id.empty()) 228 if (extension_id.empty())
229 return; 229 return;
230 230
231 const input_method::InputMethodDescriptor* ime = 231 const input_method::InputMethodDescriptor* ime =
232 input_method::InputMethodManager::Get()->GetInputMethodFromId( 232 input_method::InputMethodManager::Get()
233 input_method_id); 233 ->GetActiveIMEState()
234 ->GetInputMethodFromId(input_method_id);
234 if (!ime) 235 if (!ime)
235 return; 236 return;
236 237
237 Browser* browser = chrome::FindBrowserWithWebContents( 238 Browser* browser = chrome::FindBrowserWithWebContents(
238 web_ui()->GetWebContents()); 239 web_ui()->GetWebContents());
239 content::OpenURLParams params(ime->options_page_url(), 240 content::OpenURLParams params(ime->options_page_url(),
240 content::Referrer(), 241 content::Referrer(),
241 SINGLETON_TAB, 242 SINGLETON_TAB,
242 content::PAGE_TRANSITION_LINK, 243 content::PAGE_TRANSITION_LINK,
243 false); 244 false);
(...skipping 19 matching lines...) Expand all
263 extension_ime_util::GetExtensionIDFromInputMethodID(input_method_id); 264 extension_ime_util::GetExtensionIDFromInputMethodID(input_method_id);
264 const extensions::Extension* extension = 265 const extensions::Extension* extension =
265 enabled_extensions.GetByID(extension_id); 266 enabled_extensions.GetByID(extension_id);
266 if (extension) 267 if (extension)
267 entry->SetString("extensionName", extension->name()); 268 entry->SetString("extensionName", extension->name());
268 } 269 }
269 } 270 }
270 271
271 } // namespace options 272 } // namespace options
272 } // namespace chromeos 273 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698