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 #include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/network_screen_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/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 } | 186 } |
187 | 187 |
188 ListValue* NetworkScreenHandler::GetLanguageList() { | 188 ListValue* NetworkScreenHandler::GetLanguageList() { |
189 const std::string app_locale = g_browser_process->GetApplicationLocale(); | 189 const std::string app_locale = g_browser_process->GetApplicationLocale(); |
190 input_method::InputMethodManager* manager = | 190 input_method::InputMethodManager* manager = |
191 input_method::InputMethodManager::GetInstance(); | 191 input_method::InputMethodManager::GetInstance(); |
192 // GetSupportedInputMethods() never returns NULL. | 192 // GetSupportedInputMethods() never returns NULL. |
193 scoped_ptr<input_method::InputMethodDescriptors> descriptors( | 193 scoped_ptr<input_method::InputMethodDescriptors> descriptors( |
194 manager->GetSupportedInputMethods()); | 194 manager->GetSupportedInputMethods()); |
195 ListValue* languages_list = | 195 ListValue* languages_list = |
196 options2::CrosLanguageOptionsHandler::GetLanguageList(*descriptors); | 196 options::CrosLanguageOptionsHandler::GetLanguageList(*descriptors); |
197 for (size_t i = 0; i < languages_list->GetSize(); ++i) { | 197 for (size_t i = 0; i < languages_list->GetSize(); ++i) { |
198 DictionaryValue* language_info = NULL; | 198 DictionaryValue* language_info = NULL; |
199 if (!languages_list->GetDictionary(i, &language_info)) | 199 if (!languages_list->GetDictionary(i, &language_info)) |
200 NOTREACHED(); | 200 NOTREACHED(); |
201 | 201 |
202 std::string value; | 202 std::string value; |
203 language_info->GetString("code", &value); | 203 language_info->GetString("code", &value); |
204 std::string display_name; | 204 std::string display_name; |
205 language_info->GetString("displayName", &display_name); | 205 language_info->GetString("displayName", &display_name); |
206 std::string native_name; | 206 std::string native_name; |
(...skipping 27 matching lines...) Expand all Loading... |
234 "title", | 234 "title", |
235 util->GetInputMethodLongName(input_methods->at(i))); | 235 util->GetInputMethodLongName(input_methods->at(i))); |
236 input_method->SetBoolean("selected", | 236 input_method->SetBoolean("selected", |
237 ime_id == current_input_method_id); | 237 ime_id == current_input_method_id); |
238 input_methods_list->Append(input_method); | 238 input_methods_list->Append(input_method); |
239 } | 239 } |
240 return input_methods_list; | 240 return input_methods_list; |
241 } | 241 } |
242 | 242 |
243 } // namespace chromeos | 243 } // namespace chromeos |
OLD | NEW |